FIX: Duplicated task with linked protocol loses template loaded timestamp [SCI-8227]

This commit is contained in:
sboursen-scinote 2023-03-31 16:49:40 +02:00
parent f535bc1fa0
commit 9b8db8befd

View file

@ -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,