From 23796373f081c9060c875ba42b02d82efe9f127e Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 23 Oct 2015 11:27:15 -0400 Subject: [PATCH] Uniqueness constraint on passive skill --- app/models/passive_skill.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/passive_skill.rb b/app/models/passive_skill.rb index 6eebdbc..835e035 100644 --- a/app/models/passive_skill.rb +++ b/app/models/passive_skill.rb @@ -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