mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 13:16:28 +08:00
22 lines
416 B
Ruby
22 lines
416 B
Ruby
# frozen_string_literal: true
|
|
|
|
class GeneralNotification < BaseNotification
|
|
def message
|
|
params[:message]
|
|
end
|
|
|
|
def title
|
|
params[:title]
|
|
end
|
|
|
|
def subtype
|
|
params[:type]
|
|
end
|
|
|
|
def subject
|
|
subject_class = params[:subject_class].constantize
|
|
subject_class.find(params[:subject_id])
|
|
rescue NameError, ActiveRecord::RecordNotFound
|
|
NonExistantRecord.new(params[:subject_name])
|
|
end
|
|
end
|