mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-02 21:51:51 +08:00
add generate workflow image method for moved modules
This commit is contained in:
parent
d5c5c55bf2
commit
d146970f6b
1 changed files with 12 additions and 4 deletions
|
@ -503,10 +503,7 @@ class Experiment < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# Generate workflow image for the experiment in which we moved the task
|
||||
to_move.each_value do |id|
|
||||
experiment = Experiment.find_by_id(id)
|
||||
experiment.delay.generate_workflow_img
|
||||
end
|
||||
generate_workflow_img_for_moved_modules(to_move)
|
||||
end
|
||||
|
||||
# Move module groups; this method accepts a map where keys
|
||||
|
@ -552,8 +549,19 @@ class Experiment < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# Generate workflow image for the experiment in which we moved the workflow
|
||||
generate_workflow_img_for_moved_modules(to_move)
|
||||
end
|
||||
|
||||
# Generates workflow img when the workflow or module is moved
|
||||
# to other experiment
|
||||
def generate_workflow_img_for_moved_modules(to_move)
|
||||
experiment_ids = []
|
||||
to_move.each_value do |id|
|
||||
experiment_ids << id
|
||||
end
|
||||
experiment_ids.uniq.each do |id|
|
||||
experiment = Experiment.find_by_id(id)
|
||||
next unless experiment
|
||||
experiment.delay.generate_workflow_img
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue