summaryrefslogtreecommitdiff
path: root/app/models/gateway_header.rb
blob: 638bd8dc792a25c2b195cd39f1467c20429baed4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class GatewayHeader < ActiveRecord::Base
  HEADER_TYPES = [
    'invite', 
  #  'provisional', 
  # 'request', 
  #  'bye',
  ]

  attr_accessible :gateway_id, :header_type, :constraint_source, :constraint_value, :name, :value, :description

  belongs_to :gateway, :touch => true

  validates :name,
            :presence => true,
            :uniqueness => {:scope => [:gateway_id, :header_type, :constraint_source, :constraint_value]}

  validates :header_type,
            :presence => true,
            :inclusion => { :in => HEADER_TYPES }

  def to_s
  	name
  end
end