mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 15:36:22 +08:00
32 lines
636 B
Ruby
32 lines
636 B
Ruby
# frozen_string_literal: true
|
|
|
|
class LowStockNotification < BaseNotification
|
|
def message
|
|
I18n.t(
|
|
'notifications.content.item_low_stock_reminder.message_html',
|
|
repository_row_name: subject.name,
|
|
repository: repository.name
|
|
)
|
|
end
|
|
|
|
def self.subtype
|
|
:item_low_stock_reminder
|
|
end
|
|
|
|
def title
|
|
I18n.t(
|
|
'notifications.content.item_low_stock_reminder.message_html',
|
|
repository_row_name: subject.name,
|
|
repository: repository.name
|
|
)
|
|
end
|
|
|
|
def subject
|
|
RepositoryRow.find(params[:repository_row_id])
|
|
end
|
|
|
|
def repository
|
|
Repository.find(subject.repository_id)
|
|
end
|
|
end
|