diff options
Diffstat (limited to 'app/models/sip_domain.rb')
-rw-r--r-- | app/models/sip_domain.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/models/sip_domain.rb b/app/models/sip_domain.rb new file mode 100644 index 0000000..252fe4a --- /dev/null +++ b/app/models/sip_domain.rb @@ -0,0 +1,16 @@ +class SipDomain < ActiveRecord::Base + attr_accessible :host, :realm + + has_many :tenants, :dependent => :restrict + has_many :sip_accounts, :dependent => :restrict + + validates_presence_of :host + validates_uniqueness_of :host, :case_sensitive => false + + validates_presence_of :realm + validates_uniqueness_of :realm + + def to_s + self.host + end +end |