summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-06-12 09:28:59 +0200
committerPeter Kozak <spag@golwen.net>2013-06-12 09:28:59 +0200
commit31c6aa30b19d1e4d0ec0ae30c59483c8cc77b12c (patch)
tree2ddf25708205d96707514b06e7269716724b2393 /app/models
parent8f05b452f8d57e87fa8927b0960a17aa386c0864 (diff)
copy_existing_call_forwards_if_necessary method removed
Diffstat (limited to 'app/models')
-rw-r--r--app/models/phone_number.rb15
1 files changed, 0 insertions, 15 deletions
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