diff options
Diffstat (limited to 'app/models/pager_group_destination.rb')
-rw-r--r-- | app/models/pager_group_destination.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/pager_group_destination.rb b/app/models/pager_group_destination.rb new file mode 100644 index 0000000..98a1b32 --- /dev/null +++ b/app/models/pager_group_destination.rb @@ -0,0 +1,15 @@ +class PagerGroupDestination < ActiveRecord::Base + attr_accessible :pager_group_id, :sip_account_id + + belongs_to :pager_group + belongs_to :sip_account + + validates_presence_of :pager_group_id + validates_presence_of :sip_account_id + + after_create :call + + def call + self.sip_account.call("f-pager-#{self.pager_group_id}", '', "Pager #{self.id}") + end +end |