1
0
Fork 0

Super Attack name + description should be unique

This commit is contained in:
Andrew Tomaka 2015-10-23 11:21:26 -04:00
parent cfac2aaff7
commit f5f91f0ff9

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) }