summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-13 20:33:35 +0100
committerspag <spag@golwen.net>2013-01-13 20:33:35 +0100
commit6ae1b0df2648ccc02afa8fe375693e15117736fa (patch)
tree51b2cd5f0d0786aacd968bfa7c76ddcbe6fdb97f
parent86c322181ac1aeed7fa8dde7f7c03b570359917b (diff)
validations
-rw-r--r--app/models/gateway_parameter.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/gateway_parameter.rb b/app/models/gateway_parameter.rb
index efa52df..1875863 100644
--- a/app/models/gateway_parameter.rb
+++ b/app/models/gateway_parameter.rb
@@ -2,4 +2,12 @@ class GatewayParameter < ActiveRecord::Base
attr_accessible :gateway_id, :name, :value, :class_type, :description
belongs_to :gateway
+
+ validates :name,
+ :presence => true,
+ :uniqueness => true
+
+ validates :class_type,
+ :presence => true,
+ :inclusion => { :in => ['String', 'Integer', 'Boolean'] }
end