summaryrefslogtreecommitdiff
path: root/app/models/gateway_setting.rb
blob: cf1292dcc83bdc976137aa91135ffc371f4cf1b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class GatewaySetting < ActiveRecord::Base
  CLASS_TYPES = ['String', 'Integer', 'Boolean']
  
  attr_accessible :gateway_id, :name, :value, :class_type, :description

  belongs_to :gateway

  validates :name,
            :presence => true,
            :uniqueness => {:scope => :gateway_id}

  validates :class_type,
            :presence => true,
            :inclusion => { :in => CLASS_TYPES }

  def to_s
  	name
  end
end