diff options
author | spag <spag@golwen.net> | 2013-01-17 06:59:08 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-01-17 06:59:08 +0100 |
commit | 1d18e9d7fc16501d7622889df9d6ef05c75adb2f (patch) | |
tree | 23ce3758029b8d54cf916a409026d46dfb9ad119 /app | |
parent | c06fa7cc6a499149fc8c666e4776e84b9e920788 (diff) |
validations
Diffstat (limited to 'app')
-rw-r--r-- | app/models/call_route.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/call_route.rb b/app/models/call_route.rb index e423030..f6a3dd3 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -1,4 +1,6 @@ class CallRoute < ActiveRecord::Base + ROUTING_TABLES = ['prerouting', 'outbound', 'inbound'] + attr_accessible :table, :name, :endpoint_type, :endpoint_id, :position has_many :route_elements, :dependent => :destroy @@ -6,6 +8,10 @@ class CallRoute < ActiveRecord::Base validates :name, :presence => true + validates :table, + :presence => true, + :inclusion => { :in => ROUTING_TABLES } + acts_as_list :scope => '`table` = \'#{table}\'' def to_s |