summaryrefslogtreecommitdiff
path: root/app/models/sip_account.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-11 02:43:51 -0400
committerPeter Kozak <spag@golwen.net>2013-03-11 02:43:51 -0400
commit436368d7719a9447c5c09dc6f8b24a623b48f3b6 (patch)
treec288f4c91d7937303f5f2553c60aa16062bcab73 /app/models/sip_account.rb
parent0c5c2bc651bc701117d376a68905cb7d2f913449 (diff)
parentbeb9e66a5b4e2744435f2c1f301828b68a58c96a (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/models/sip_account.rb')
-rw-r--r--app/models/sip_account.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index bb45a4c..cea5f0e 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -42,6 +42,7 @@ class SipAccount < ActiveRecord::Base
has_many :b_call_legs, :class_name => 'Call', :foreign_key => 'b_sip_account_id'
has_many :acd_agents, :as => :destination, :dependent => :destroy
+ has_many :switchboard_entries, :dependent => :destroy
# Delegations:
#
@@ -212,6 +213,11 @@ class SipAccount < ActiveRecord::Base
return states
end
+ def non_e164_phone_numbers
+ array_of_phone_numbers_as_strings = self.phone_numbers.map{ |phone_number| phone_number.number.to_s }.sort
+ self.phone_numbers.where(:number => array_of_phone_numbers_as_strings.select { |phone_number| phone_number[0] != '+' })
+ end
+
private
def save_value_of_to_s