From 58e71c29b3b158fe8e68a19f4d40a827c87397cc Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Mon, 3 Dec 2012 17:25:07 +0800 Subject: [PATCH] uniq relation --- app/models/user/co_author_relation.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user/co_author_relation.rb b/app/models/user/co_author_relation.rb index b4fb40ea..f0d5f17c 100644 --- a/app/models/user/co_author_relation.rb +++ b/app/models/user/co_author_relation.rb @@ -6,5 +6,6 @@ class CoAuthorRelation has_and_belongs_to_many :co_authors - validates :relation, presence: true + validates :relation, presence: true, + uniqueness: { case_sensitive: false } end