summaryrefslogtreecommitdiff
path: root/app/models/gateway_parameter.rb
blob: 3dd2a95a10d6fbe7dd0700815ae8b869bf938253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class GatewayParameter < ActiveRecord::Base
  attr_accessible :gateway_id, :name, :value, :class_type, :description

  belongs_to :gateway, :touch => true

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

  validates :class_type,
            :presence => true,
            :inclusion => { :in => ['String', 'Integer', 'Boolean'] }

  def to_s
  	name
  end
end