mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-27 14:37:35 +08:00
Merge pull request #3358 from okriuchykhin/ok_SCI_5773
Remove experiment from report if it is moved to another project [SCI-5773]
This commit is contained in:
commit
6d56ea2ee0
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…
Add table
Reference in a new issue