summaryrefslogtreecommitdiff
path: root/app/models/sip_domain.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:01:45 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:01:45 +0100
commitb80bd744ad873f6fc43018bc4bfb90677de167bd (patch)
tree072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/models/sip_domain.rb
parent3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff)
Start of GS5.
Diffstat (limited to 'app/models/sip_domain.rb')
-rw-r--r--app/models/sip_domain.rb16
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