scinote-web/app/notifications/general_notification.rb

23 lines
416 B
Ruby
Raw Normal View History

2023-10-11 19:43:20 +08:00
# frozen_string_literal: true
class GeneralNotification < BaseNotification
2023-10-11 19:43:20 +08:00
def message
params[:message]
end
def title
params[:title]
end
2023-11-24 21:58:46 +08:00
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
2023-10-11 19:43:20 +08:00
end