From 31c6aa30b19d1e4d0ec0ae30c59483c8cc77b12c Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 12 Jun 2013 09:28:59 +0200 Subject: copy_existing_call_forwards_if_necessary method removed --- app/models/phone_number.rb | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'app/models/phone_number.rb') diff --git a/app/models/phone_number.rb b/app/models/phone_number.rb index 193e4a8..4f92731 100644 --- a/app/models/phone_number.rb +++ b/app/models/phone_number.rb @@ -16,7 +16,6 @@ class PhoneNumber < ActiveRecord::Base validate :validate_inbound_uniqueness before_save :save_value_of_to_s - after_create :copy_existing_call_forwards_if_necessary before_validation :'parse_and_split_number!' validate :validate_number, :if => Proc.new { |phone_number| GsParameter.get('STRICT_INTERNAL_EXTENSION_HANDLING') && GsParameter.get('STRICT_DID_HANDLING') } validate :check_if_number_is_available, :if => Proc.new { |phone_number| GsParameter.get('STRICT_INTERNAL_EXTENSION_HANDLING') && GsParameter.get('STRICT_DID_HANDLING') } @@ -313,18 +312,4 @@ class PhoneNumber < ActiveRecord::Base def save_value_of_to_s self.value_of_to_s = self.to_s end - - def copy_existing_call_forwards_if_necessary - if self.phone_numberable.class == SipAccount && self.phone_numberable.callforward_rules_act_per_sip_account == true - sip_account = SipAccount.find(self.phone_numberable) - if sip_account.phone_numbers.where('id != ?', self.id).count > 0 - if sip_account.phone_numbers.where('id != ?', self.id).order(:created_at).first.call_forwards.count > 0 - sip_account.phone_numbers.where('id != ?', self.id).first.call_forwards.each do |call_forward| - call_forward.set_this_callforward_rule_to_all_phone_numbers_of_the_parent_sip_account - end - end - end - end - end - end -- cgit v1.2.3