diff options
-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 |