1
0
Fork 0

Merge branch 'development' into 'master'

Development

Bugfixes to add uniqueness constraints to Super Attacks and Leader Skills

See merge request !7
This commit is contained in:
Andrew Tomaka 2015-10-23 11:29:04 -04:00
commit aee4ec8da4
3 changed files with 6 additions and 3 deletions

View file

@ -1,5 +1,6 @@
class LeaderSkill < ActiveRecord::Base
has_paper_trail
validates :description, presence: true
validates :description, presence: true,
uniqueness: { case_sensitive: false }
end

View file

@ -2,7 +2,8 @@ class PassiveSkill < ActiveRecord::Base
has_paper_trail
validates :name, presence: true
validates :description, presence: true
validates :description, presence: true,
uniqueness: { scope: :name }
default_scope { order(:name) }
end

View file

@ -2,7 +2,8 @@ class SuperAttack < ActiveRecord::Base
has_paper_trail
validates :name, presence: true
validates :description, presence: true
validates :description, presence: true,
uniqueness: { scope: :name }
default_scope { order(:name) }