mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-10 14:46:42 +08:00
Fix experiment copy
This commit is contained in:
parent
18b31875bb
commit
43ff9f6f26
1 changed files with 2 additions and 3 deletions
|
@ -417,10 +417,9 @@ class MyModule < ApplicationRecord
|
|||
deep_clone_to_experiment(current_user, experiment)
|
||||
end
|
||||
|
||||
def deep_clone_to_experiment(current_user, experiment)
|
||||
def deep_clone_to_experiment(current_user, experiment_dest)
|
||||
# Copy the module
|
||||
clone = MyModule.new(name: name, experiment: experiment, description: description, x: x, y: y)
|
||||
|
||||
clone = MyModule.new(name: name, experiment: experiment_dest, description: description, x: x, y: y)
|
||||
# set new position if cloning in the same experiment
|
||||
clone.attributes = get_new_position if clone.experiment == experiment
|
||||
|
||||
|
|
Loading…
Reference in a new issue