summaryrefslogtreecommitdiff
path: root/app/models/sip_account.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-10 12:06:06 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-10 12:06:06 +0100
commitc563859fa60defd2b40f17a0b7cf1c4912f72792 (patch)
treed1f9e4f478fdc70bd85117fe567e049346888603 /app/models/sip_account.rb
parent13e16223977966f9751e7b8e3fb587e2df0a0801 (diff)
added non_e164_phone_numbers method
Diffstat (limited to 'app/models/sip_account.rb')
-rw-r--r--app/models/sip_account.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index 930069d..cea5f0e 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -213,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