summaryrefslogtreecommitdiff
path: root/app/models/call_forward.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-07-05 13:03:15 +0200
committerPeter Kozak <spag@golwen.net>2013-07-05 13:03:15 +0200
commitf2b72ef12ed2bfb2d942fd6654d8816f863b0970 (patch)
tree10a5371529c3d691cbb442dff6218895f1e53971 /app/models/call_forward.rb
parenta537ffee59d1df6ecc5e22e51833b28deb2753b5 (diff)
fix for java-script less browsers
Diffstat (limited to 'app/models/call_forward.rb')
-rw-r--r--app/models/call_forward.rb27
1 files changed, 26 insertions, 1 deletions
diff --git a/app/models/call_forward.rb b/app/models/call_forward.rb
index a4bfbb5..159eb84 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.downcase == 'phonenumber'
+ return self.destination
+ end
+ end
+
+ def destination_phone_number=(destination_number)
+ if self.destinationable_type.downcase == 'phonenumber'
+ self.destination = destination_number
+ end
+ end
+
+ def destination_greeting
+ if self.destinationable_type.downcase == 'voicemailaccount'
+ return self.destination
+ end
+ end
+
+ def destination_greeting=(destination_file)
+ if self.destinationable_type.downcase == 'voicemailaccount'
+ self.destination = destination_file
+ end
+ end
+
def toggle
self.active = ! self.active
return self.save