From d707f9121c71a96bbd8853d719f473d14b913e64 Mon Sep 17 00:00:00 2001 From: Andrej Date: Tue, 29 Oct 2024 15:12:27 +0100 Subject: [PATCH] Remove constraint for the protocol template name [SCI-10851] --- app/models/protocol.rb | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/app/models/protocol.rb b/app/models/protocol.rb index 1c961de68..6a5a61e2a 100644 --- a/app/models/protocol.rb +++ b/app/models/protocol.rb @@ -75,21 +75,6 @@ class Protocol < ApplicationRecord # Only one draft can exist for each protocol validate :ensure_single_draft end - with_options if: -> { in_repository? && !parent && !archived_changed?(from: false) } do |protocol| - # Active protocol must have unique name inside its team - protocol - .validates_uniqueness_of :name, case_sensitive: false, - scope: :team, - conditions: lambda { - where( - protocol_type: [ - Protocol.protocol_types[:in_repository_published_original], - Protocol.protocol_types[:in_repository_draft] - ], - parent_id: nil - ) - } - end with_options if: -> { in_repository? && archived? && !previous_version } do |protocol| protocol.validates :archived_by, presence: true protocol.validates :archived_on, presence: true