From 8e42dba7de0cf741015a8bf62296afffc12cd9c2 Mon Sep 17 00:00:00 2001 From: Zanz2 Date: Tue, 3 Jul 2018 08:20:56 +0200 Subject: [PATCH] Found the fix --- app/models/protocol.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/protocol.rb b/app/models/protocol.rb index e443ea1b7..ec92b0978 100644 --- a/app/models/protocol.rb +++ b/app/models/protocol.rb @@ -43,7 +43,7 @@ class Protocol < ApplicationRecord with_options if: :in_repository_public? do |protocol| # Public protocol must have unique name inside its team protocol - .validates_uniqueness_of :name, + .validates_uniqueness_of :name, case_sensitive: false, scope: :team, conditions: -> { where( @@ -57,7 +57,7 @@ class Protocol < ApplicationRecord with_options if: :in_repository_private? do |protocol| # Private protocol must have unique name inside its team & user scope protocol - .validates_uniqueness_of :name, + .validates_uniqueness_of :name, case_sensitive: false, scope: [:team, :added_by], conditions: -> { where( @@ -70,7 +70,7 @@ class Protocol < ApplicationRecord with_options if: :in_repository_archived? do |protocol| # Archived protocol must have unique name inside its team & user scope protocol - .validates_uniqueness_of :name, + .validates_uniqueness_of :name, case_sensitive: false, scope: [:team, :added_by], conditions: -> { where(