mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-10 22:53:06 +08:00
Merge pull request #139 from ZmagoD/zd_SCI_410
fixed moved experiment thumbnail [fixes SCI-410]
This commit is contained in:
commit
7c4a62d138
1 changed files with 18 additions and 1 deletions
|
@ -377,6 +377,7 @@ class Experiment < ActiveRecord::Base
|
|||
end
|
||||
|
||||
save
|
||||
touch(:workflowimg_updated_at)
|
||||
end
|
||||
|
||||
# Get projects where user is either owner or user in the same organization
|
||||
|
@ -498,8 +499,11 @@ class Experiment < ActiveRecord::Base
|
|||
raise ActiveRecord::ActiveRecordError
|
||||
end
|
||||
|
||||
my_module.save!
|
||||
my_module.save
|
||||
end
|
||||
|
||||
# Generate workflow image for the experiment in which we moved the task
|
||||
generate_workflow_img_for_moved_modules(to_move)
|
||||
end
|
||||
|
||||
# Move module groups; this method accepts a map where keys
|
||||
|
@ -543,6 +547,19 @@ class Experiment < ActiveRecord::Base
|
|||
group.save!
|
||||
end
|
||||
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)
|
||||
to_move.values.uniq.each do |id|
|
||||
experiment = Experiment.find_by_id(id)
|
||||
next unless experiment
|
||||
experiment.delay.generate_workflow_img
|
||||
end
|
||||
end
|
||||
|
||||
# Update connections for all modules in this project.
|
||||
|
|
Loading…
Reference in a new issue