Remove task from report if it is moved to another experiment [SCI-5741]

This commit is contained in:
Oleksii Kriuchykhin 2021-05-20 21:21:27 +02:00
parent 371a51c4de
commit 7d9a79456a

View file

@ -8,10 +8,11 @@ class MyModule < ApplicationRecord
enum state: Extends::TASKS_STATES
before_validation :archiving_and_restoring_extras, on: :update, if: :archived_changed?
before_save -> { report_elements.destroy_all }, if: -> { !new_record? && experiment_id_changed? }
around_save :exec_status_consequences, if: :my_module_status_id_changed?
before_create :create_blank_protocol
before_create :assign_default_status_flow
before_validation :archiving_and_restoring_extras, on: :update, if: :archived_changed?
around_save :exec_status_consequences, if: :my_module_status_id_changed?
after_save -> { experiment.workflowimg.purge },
if: -> { (saved_changes.keys & %w(x y experiment_id my_module_group_id input_id output_id archived)).any? }