From f5f91f0ff9cddc10ec90c2163a618352460e1bf5 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 23 Oct 2015 11:21:26 -0400 Subject: [PATCH] Super Attack name + description should be unique --- app/models/super_attack.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/super_attack.rb b/app/models/super_attack.rb index 332c480..ad32ec1 100644 --- a/app/models/super_attack.rb +++ b/app/models/super_attack.rb @@ -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) }