mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-05 04:03:45 +08:00
Fix creating RepositoryStockConsumptionValues in repository snapshots [SCI-10908]
This commit is contained in:
parent
121a30ede6
commit
70a03db57a
1 changed files with 10 additions and 1 deletions
|
@ -52,7 +52,16 @@ class RepositoryCell < ApplicationRecord
|
|||
}
|
||||
|
||||
def update_repository_row_last_modified_by
|
||||
repository_row.update!(last_modified_by_id: value.last_modified_by_id)
|
||||
# RepositoryStockConsumptionValue currently don't store last_modified_by
|
||||
# so this would fail. Should probably be refactored to unify the behaviour (23.7.2024)
|
||||
if value.last_modified_by_id
|
||||
repository_row.update!(last_modified_by_id: value.last_modified_by_id)
|
||||
else
|
||||
Rails.logger.warn(
|
||||
"Missing last_modified_by_id for #{value.class} with id #{value.id}, " \
|
||||
"skipping update of last_modified_by on RepositoryRow with id #{repository_row_id}."
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def self.create_with_value!(row, column, data, user)
|
||||
|
|
Loading…
Reference in a new issue