mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-25 01:04:02 +08:00
Fix inventory item date notification for deleted date columns [SCI-9921]
This commit is contained in:
parent
d8cb0b6cf2
commit
5fe001867b
1 changed files with 2 additions and 8 deletions
|
@ -6,11 +6,11 @@ class RepositoryItemDateNotification < BaseNotification
|
||||||
end
|
end
|
||||||
|
|
||||||
def title
|
def title
|
||||||
unit = human_readable_unit(column.metadata['reminder_unit'], column.metadata['reminder_value'])
|
unit = human_readable_unit(params[:reminder_unit], params[:reminder_value])
|
||||||
I18n.t(
|
I18n.t(
|
||||||
'notifications.content.item_date_reminder.message_html',
|
'notifications.content.item_date_reminder.message_html',
|
||||||
repository_row_name: subject.name,
|
repository_row_name: subject.name,
|
||||||
value: column.metadata['reminder_value'],
|
value: params[:reminder_value],
|
||||||
units: unit
|
units: unit
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -21,12 +21,6 @@ class RepositoryItemDateNotification < BaseNotification
|
||||||
NonExistantRecord.new(params[:repository_row_name])
|
NonExistantRecord.new(params[:repository_row_name])
|
||||||
end
|
end
|
||||||
|
|
||||||
def column
|
|
||||||
RepositoryColumn.find(params[:repository_column_id])
|
|
||||||
rescue ActiveRecord::RecordNotFound
|
|
||||||
NonExistantRecord.new(params[:repository_column_name])
|
|
||||||
end
|
|
||||||
|
|
||||||
after_deliver do
|
after_deliver do
|
||||||
if params[:repository_date_time_value_id]
|
if params[:repository_date_time_value_id]
|
||||||
RepositoryDateTimeValue.find(params[:repository_date_time_value_id]).update(notification_sent: true)
|
RepositoryDateTimeValue.find(params[:repository_date_time_value_id]).update(notification_sent: true)
|
||||||
|
|
Loading…
Reference in a new issue