mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 23:16:15 +08:00
FIX: Duplicated task with linked protocol loses template loaded timestamp [SCI-8227]
This commit is contained in:
parent
f535bc1fa0
commit
9b8db8befd
|
@ -16,6 +16,7 @@ class Protocol < ApplicationRecord
|
|||
include PermissionCheckableModel
|
||||
include TinyMceImages
|
||||
|
||||
after_create :set_linked_at, if: -> { linked? && linked_at.blank? }
|
||||
after_create :update_automatic_user_assignments, if: -> { visible? && in_repository? && parent.blank? }
|
||||
before_update :change_visibility, if: :default_public_user_role_id_changed?
|
||||
after_update :update_automatic_user_assignments,
|
||||
|
@ -579,6 +580,11 @@ class Protocol < ApplicationRecord
|
|||
deep_clone(clone, current_user)
|
||||
end
|
||||
|
||||
def set_linked_at
|
||||
self.linked_at = self.created_at
|
||||
self.save!
|
||||
end
|
||||
|
||||
def deep_clone_repository(current_user)
|
||||
clone = Protocol.new(
|
||||
name: name,
|
||||
|
|
Loading…
Reference in a new issue