Skip to content

Commit

Permalink
Revert "remove explicit autosave on assay_assets and observation_unit…
Browse files Browse the repository at this point in the history
…_assets associations #1981"

This reverts commit 512a6c5.
  • Loading branch information
stuzart committed Sep 18, 2024
1 parent 512a6c5 commit 4a0c2d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/assay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Assay < ApplicationRecord
has_many :tissue_and_cell_types, through: :assay_organisms

before_save { assay_assets.each(&:set_version) }
has_many :assay_assets, dependent: :destroy, inverse_of: :assay
has_many :assay_assets, dependent: :destroy, inverse_of: :assay, autosave: true

has_many :data_files, through: :assay_assets, source: :asset, source_type: 'DataFile', inverse_of: :assays
has_many :placeholders, through: :assay_assets, source: :asset, source_type: 'Placeholder', inverse_of: :assays
Expand Down
2 changes: 1 addition & 1 deletion app/models/observation_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ObservationUnit < ApplicationRecord
has_one :investigation, through: :study
has_many :samples
has_many :related_assays, -> { distinct }, through: :samples, source: :assays
has_many :observation_unit_assets, inverse_of: :observation_unit, dependent: :delete_all
has_many :observation_unit_assets, inverse_of: :observation_unit, dependent: :delete_all, autosave: true
has_many :data_files, through: :observation_unit_assets, source: :asset, source_type: 'DataFile', inverse_of: :observation_units
has_many :assay_data_files, -> { distinct }, through: :related_assays, source: :data_files
has_many :assay_sops, -> { distinct }, through: :related_assays, source: :sops
Expand Down

0 comments on commit 4a0c2d1

Please sign in to comment.