summaryrefslogtreecommitdiff
path: root/app/models/call_route.rb
blob: 0df961d0b79dcfc3a5b1044ad104e106f211e969 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class CallRoute < ActiveRecord::Base
  ROUTING_TABLES = ['prerouting', 'outbound', 'inbound']

  attr_accessible :routing_table, :name, :endpoint_type, :endpoint_id, :position

  has_many :route_elements, :dependent => :destroy

  validates :name,
  					:presence => true

  validates :table,
            :presence => true,
            :inclusion => { :in => ROUTING_TABLES }

  acts_as_list :scope => '`routing_table` = \'#{routing_table}\''

  def to_s
    name.to_s
  end
end