diff options
author | spag <spag@golwen.net> | 2013-01-09 11:08:49 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-01-09 11:08:49 +0100 |
commit | af1a7678582e2e629ed4c8c06528b9a62bf62242 (patch) | |
tree | 944e23c10bed64e6acfa4891f3c0318cce8a34f3 | |
parent | d968c1f9a6933c3e5d2b2f16d38d656edb6fe152 (diff) |
entity added to GsParameter
-rw-r--r-- | app/models/gs_parameter.rb | 4 | ||||
-rw-r--r-- | db/migrate/20130109074326_add_entity_to_gs_parameter.rb | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/models/gs_parameter.rb b/app/models/gs_parameter.rb index 9d9e996..de09df6 100644 --- a/app/models/gs_parameter.rb +++ b/app/models/gs_parameter.rb @@ -1,9 +1,9 @@ class GsParameter < ActiveRecord::Base - attr_accessible :name, :section, :value, :class_type, :description + attr_accessible :entity, :name, :section, :value, :class_type, :description validates :name, :presence => true, - :uniqueness => true + :uniqueness => { :scope => [ :entity, :section ] } validates :value, :presence => true diff --git a/db/migrate/20130109074326_add_entity_to_gs_parameter.rb b/db/migrate/20130109074326_add_entity_to_gs_parameter.rb new file mode 100644 index 0000000..25091c9 --- /dev/null +++ b/db/migrate/20130109074326_add_entity_to_gs_parameter.rb @@ -0,0 +1,6 @@ +class AddEntityToGsParameter < ActiveRecord::Migration + def change + add_column :gs_parameters, :entity, :string, :after => :id + + end +end |