From a65c4ec370b60a4739e0b87ba398e5e25e3b1340 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 4 Jan 2013 09:12:58 +0100 Subject: return true if login was successful but phone resync failed --- app/models/phone.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'app/models/phone.rb') diff --git a/app/models/phone.rb b/app/models/phone.rb index a606834..a59b003 100644 --- a/app/models/phone.rb +++ b/app/models/phone.rb @@ -162,7 +162,6 @@ class Phone < ActiveRecord::Base if ! self.resync(true, sip_account_resync) errors.add(:resync, "Resync failed") - return false end return true -- cgit v1.2.3 From 2e3bddd415f03aa15cd2759d7c18f64d5545ea80 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 12 Jan 2013 10:53:20 +0100 Subject: Accept truncated MAC addresses. #80 --- app/models/phone.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models/phone.rb') diff --git a/app/models/phone.rb b/app/models/phone.rb index a59b003..4865a12 100644 --- a/app/models/phone.rb +++ b/app/models/phone.rb @@ -200,6 +200,10 @@ class Phone < ActiveRecord::Base # Sanitize MAC address. # def sanitize_mac_address + if self.mac_address.split(/:/).count == 6 && self.mac_address.length < 17 + splitted_mac_address = self.mac_address.split(/:/) + self.mac_address = splitted_mac_address.map{|part| (part.size == 1 ? "0#{part}" : part)}.join('') + end self.mac_address = self.mac_address.to_s.upcase.gsub( /[^A-F0-9]/, '' ) end -- cgit v1.2.3 From 45ab6dc23ef7d8d6ddf60ab355c2d1b3450f35c8 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 12 Jan 2013 22:54:59 +0100 Subject: Cache fixes. --- app/models/phone.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/phone.rb') diff --git a/app/models/phone.rb b/app/models/phone.rb index 4865a12..8b41b59 100644 --- a/app/models/phone.rb +++ b/app/models/phone.rb @@ -9,7 +9,7 @@ class Phone < ActiveRecord::Base # Associations # belongs_to :phone_model - belongs_to :phoneable, :polymorphic => true + belongs_to :phoneable, :polymorphic => true, :touch => true has_many :phone_sip_accounts, :dependent => :destroy, :uniq => true, :order => :position has_many :sip_accounts, :through => :phone_sip_accounts -- cgit v1.2.3