1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
class GatewayHeader < ActiveRecord::Base
HEADER_TYPES = [
'default',
'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
|