summaryrefslogtreecommitdiff
path: root/app/models/sip_domain.rb
blob: 252fe4a03e10ef74881287aae23b97b5c1247edd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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