mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 19:53:19 +08:00
Remove experiment from report if it is moved to another project [SCI-5773]
This commit is contained in:
parent
54d6427700
commit
cc8cc595d7
1 changed files with 2 additions and 0 deletions
|
@ -3,6 +3,8 @@ class Experiment < ApplicationRecord
|
|||
include SearchableModel
|
||||
include SearchableByNameModel
|
||||
|
||||
before_save -> { report_elements.destroy_all }, if: -> { !new_record? && project_id_changed? }
|
||||
|
||||
belongs_to :project, inverse_of: :experiments, touch: true
|
||||
belongs_to :created_by,
|
||||
foreign_key: :created_by_id,
|
||||
|
|
Loading…
Reference in a new issue