Merge pull request #6386 from rekonder/aj_SCI_9484

Fix unsharing of repository rows [SCI-9484]
This commit is contained in:
Alex Kriuchykhin 2023-10-09 11:06:23 +02:00 committed by GitHub
commit efa0149c9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -14,7 +14,7 @@ class MyModuleRepositoryRow < ApplicationRecord
touch: true,
inverse_of: :my_module_repository_rows
belongs_to :repository_stock_unit_item, optional: true
has_many :repository_ledger_records, as: :reference, dependent: :nullify
has_many :repository_ledger_records, as: :reference
validates :repository_row, uniqueness: { scope: :my_module }

View file

@ -75,13 +75,13 @@ module RepositoryStockLedgerZipExport
]
breadcrumbs_data = Array.new(5)
if consumption_type == 'Task'
my_module = record.my_module_repository_row.my_module
my_module = record.my_module_repository_row&.my_module
breadcrumbs_data = [
my_module.experiment.project.team.name,
my_module.experiment.project.name,
my_module.experiment.name,
my_module.name,
my_module.code
my_module&.experiment&.project&.team&.name,
my_module&.experiment&.project&.name,
my_module&.experiment&.name,
my_module&.name,
my_module&.code
]
end