From a8ccc18b8b624ce9c04a4d5dfe27c6a43d80a636 Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 25 Jul 2022 12:53:27 +0200 Subject: [PATCH] Fix protocol save to repository [SCI-6965] --- app/models/protocol.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/protocol.rb b/app/models/protocol.rb index 2ebaaf9e7..f3b5a87de 100644 --- a/app/models/protocol.rb +++ b/app/models/protocol.rb @@ -253,9 +253,10 @@ class Protocol < ApplicationRecord end end - def self.clone_contents(src, dest, current_user, clone_keywords) + def self.clone_contents(src, dest, current_user, clone_keywords, only_contents = false) assets_to_clone = [] - dest.update(description: src.description, name: src.name) + dest.update(description: src.description, name: src.name) unless only_contents + src.clone_tinymce_assets(dest, dest.team) # Update keywords @@ -736,7 +737,7 @@ class Protocol < ApplicationRecord raise ActiveRecord::RecordNotSaved unless success - Protocol.clone_contents(self, clone, current_user, true) + Protocol.clone_contents(self, clone, current_user, true, true) clone.reload clone