Super Attack name + description should be unique
This commit is contained in:
parent
cfac2aaff7
commit
f5f91f0ff9
1 changed files with 2 additions and 1 deletions
|
@ -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) }
|
||||
|
||||
|
|
Loading…
Reference in a new issue