mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-10 15:14:33 +08:00
Merge pull request #8004 from andrej-scinote/aj_SCI_10851
Remove constraint for the protocol template name [SCI-10851]
This commit is contained in:
commit
004745d4e7
1 changed files with 0 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue