summaryrefslogtreecommitdiff
path: root/app/models/call_route.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-17 09:52:00 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-17 09:52:00 +0100
commitc09073174bb51561030a48f95f283b63b0ddae34 (patch)
treefb82681cf83c4a9cbe6fe310f2ea8942c8311d4f /app/models/call_route.rb
parent416a9c563ed52b2b4f5350b8a069313f5843489c (diff)
parent85d8dc12c3963f78ea1db4089c6ff2fa6ec205e9 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/models/call_route.rb')
-rw-r--r--app/models/call_route.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/call_route.rb b/app/models/call_route.rb
index de0f68a..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,12 @@ 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
name.to_s
end