summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-13 20:33:32 +0100
committerspag <spag@golwen.net>2013-01-13 20:33:32 +0100
commit86c322181ac1aeed7fa8dde7f7c03b570359917b (patch)
tree3fbba7eb679868c07dd801e99fa33c0f05f17a50 /app
parentf10b264bbae53a7128b22c385201161d21a9000f (diff)
validations
Diffstat (limited to 'app')
-rw-r--r--app/models/gateway_setting.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/gateway_setting.rb b/app/models/gateway_setting.rb
index c6c0b9a..bc676a4 100644
--- a/app/models/gateway_setting.rb
+++ b/app/models/gateway_setting.rb
@@ -2,4 +2,12 @@ class GatewaySetting < 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