Merge pull request #7839 from artoscinote/ma_SCI_11015

Fix destroying repository rows [SCI-11015]
This commit is contained in:
Martin Artnik 2024-09-10 11:24:43 +02:00 committed by GitHub
commit 79409830af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -98,6 +98,11 @@ class RepositoryRow < ApplicationRecord
class_name: 'RepositoryRow',
source: :parent,
dependent: :destroy
has_many :discarded_storage_location_repository_rows,
-> { discarded },
class_name: 'StorageLocationRepositoryRow',
inverse_of: :repository_row,
dependent: :destroy
has_many :storage_location_repository_rows, inverse_of: :repository_row, dependent: :destroy
has_many :storage_locations, through: :storage_location_repository_rows