summaryrefslogtreecommitdiff
path: root/app/models/gateway_parameter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/gateway_parameter.rb')
-rw-r--r--app/models/gateway_parameter.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/gateway_parameter.rb b/app/models/gateway_parameter.rb
index 1875863..3dd2a95 100644
--- a/app/models/gateway_parameter.rb
+++ b/app/models/gateway_parameter.rb
@@ -1,13 +1,17 @@
class GatewayParameter < ActiveRecord::Base
attr_accessible :gateway_id, :name, :value, :class_type, :description
- belongs_to :gateway
+ belongs_to :gateway, :touch => true
validates :name,
:presence => true,
- :uniqueness => true
+ :uniqueness => {:scope => :gateway_id}
validates :class_type,
:presence => true,
:inclusion => { :in => ['String', 'Integer', 'Boolean'] }
+
+ def to_s
+ name
+ end
end