mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-17 02:24:34 +08:00
Fix draft creation [SCI-8075]
This commit is contained in:
parent
d1f26e1c7b
commit
b4b5b70331
1 changed files with 3 additions and 2 deletions
|
@ -586,12 +586,13 @@ class Protocol < ApplicationRecord
|
|||
end
|
||||
|
||||
def save_as_draft(current_user)
|
||||
version = (latest_published_version || self).version_number + 1
|
||||
parent_protocol = parent || self
|
||||
version = (parent_protocol.latest_published_version || self).version_number + 1
|
||||
|
||||
draft = dup
|
||||
draft.version_number = version
|
||||
draft.protocol_type = :in_repository_draft
|
||||
draft.parent = (parent || self)
|
||||
draft.parent = parent_protocol
|
||||
draft.published_by = nil
|
||||
draft.published_on = nil
|
||||
draft.version_comment = nil
|
||||
|
|
Loading…
Add table
Reference in a new issue