diff options
author | Peter Kozak <spag@golwen.net> | 2013-07-09 12:11:16 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-07-09 12:11:16 +0200 |
commit | e1b8a3961833f66f03659d16b2737ab62efd999c (patch) | |
tree | ffa3a2e0ea10752e1be5da571650e4df3b6ad1dd /app/models/call_forward.rb | |
parent | e59fda6f6dd64dfe0bd2cdea66b19e3ba1fa4f90 (diff) | |
parent | 3def6156141c1235d1ab0782900d43c097676243 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/models/call_forward.rb')
-rw-r--r-- | app/models/call_forward.rb | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/app/models/call_forward.rb b/app/models/call_forward.rb index a4bfbb5..0df2a35 100644 --- a/app/models/call_forward.rb +++ b/app/models/call_forward.rb @@ -7,7 +7,8 @@ class CallForward < ActiveRecord::Base :hunt_group_id, :call_forwardable_type, :call_forwardable_id, :call_forwarding_destination, :position, :uuid, - :destinationable_type, :destinationable_id + :destinationable_type, :destinationable_id, + :destination_phone_number, :destination_greeting belongs_to :call_forwardable, :polymorphic => true belongs_to :destinationable, :polymorphic => true @@ -88,6 +89,30 @@ class CallForward < ActiveRecord::Base self.destinationable_id, delimeter, self.destinationable_type = destination_record.to_s.partition(':') end + def destination_phone_number + if self.destinationable_type.to_s.downcase == 'phonenumber' + return self.destination + end + end + + def destination_phone_number=(destination_number) + if self.destinationable_type.to_s.downcase == 'phonenumber' + self.destination = destination_number + end + end + + def destination_greeting + if self.destinationable_type.to_s.downcase == 'voicemailaccount' + return self.destination + end + end + + def destination_greeting=(destination_file) + if self.destinationable_type.to_s.downcase == 'voicemailaccount' + self.destination = destination_file + end + end + def toggle self.active = ! self.active return self.save |