diff options
Diffstat (limited to 'app/models/gateway.rb')
-rw-r--r-- | app/models/gateway.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/gateway.rb b/app/models/gateway.rb index 6a7514c..72cf72c 100644 --- a/app/models/gateway.rb +++ b/app/models/gateway.rb @@ -1,6 +1,17 @@ class Gateway < ActiveRecord::Base + TECHNOLOGIES = ['sip'] + attr_accessible :name, :technology, :inbound, :outbound, :description has_many :gateway_settings, :dependent => :destroy has_many :gateway_parameters, :dependent => :destroy + + validates :name, + :presence => true, + :uniqueness => true + + validates :technology, + :presence => true, + :inclusion => { :in => TECHNOLOGIES } + end |