mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 11:57:16 +08:00
Fix protocol save to repository [SCI-6965]
This commit is contained in:
parent
6f72777acd
commit
a8ccc18b8b
1 changed files with 4 additions and 3 deletions
|
@ -253,9 +253,10 @@ class Protocol < ApplicationRecord
|
||||||
end
|
end
|
||||||
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 = []
|
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)
|
src.clone_tinymce_assets(dest, dest.team)
|
||||||
|
|
||||||
# Update keywords
|
# Update keywords
|
||||||
|
@ -736,7 +737,7 @@ class Protocol < ApplicationRecord
|
||||||
|
|
||||||
raise ActiveRecord::RecordNotSaved unless success
|
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.reload
|
||||||
clone
|
clone
|
||||||
|
|
Loading…
Add table
Reference in a new issue