Fix destroying repository rows [SCI-11015]

This commit is contained in:
Martin Artnik 2024-09-10 10:19:28 +02:00
parent 7f47256e3a
commit e3a5b15180

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