diff options
Diffstat (limited to 'app/models/gateway_parameter.rb')
-rw-r--r-- | app/models/gateway_parameter.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/models/gateway_parameter.rb b/app/models/gateway_parameter.rb new file mode 100644 index 0000000..a66af75 --- /dev/null +++ b/app/models/gateway_parameter.rb @@ -0,0 +1,19 @@ +class GatewayParameter < ActiveRecord::Base + CLASS_TYPES = ['String', 'Integer', 'Boolean'] + + 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 => CLASS_TYPES } + + def to_s + name + end +end |