diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/pager_group.rb | 8 | ||||
-rw-r--r-- | app/models/pager_group_destination.rb | 8 | ||||
-rw-r--r-- | app/models/sip_account.rb | 2 |
3 files changed, 18 insertions, 0 deletions
diff --git a/app/models/pager_group.rb b/app/models/pager_group.rb new file mode 100644 index 0000000..861377f --- /dev/null +++ b/app/models/pager_group.rb @@ -0,0 +1,8 @@ +class PagerGroup < ActiveRecord::Base + attr_accessible :sip_account_id, :callback_url + + has_many :pager_group_destinations, :dependent => :destroy + belongs_to :sip_account + + validates_presence_of :sip_account_id +end diff --git a/app/models/pager_group_destination.rb b/app/models/pager_group_destination.rb new file mode 100644 index 0000000..333d10f --- /dev/null +++ b/app/models/pager_group_destination.rb @@ -0,0 +1,8 @@ +class PagerGroupDestination < ActiveRecord::Base + attr_accessible :pager_group_id, :sip_account_id + + belongs_to :pager_group + + validates_presence_of :pager_group_id + validates_presence_of :sip_account_id +end diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb index 77fe87a..e4ecfc4 100644 --- a/app/models/sip_account.rb +++ b/app/models/sip_account.rb @@ -46,6 +46,8 @@ class SipAccount < ActiveRecord::Base has_many :voicemail_accounts, :as => :voicemail_accountable, :dependent => :destroy belongs_to :voicemail_account + has_many :pager_groups, :dependent => :destroy + # Delegations: # delegate :host, :to => :sip_domain, :allow_nil => true |