36ee253a1a
We had client-side notification stacking in the tray since launch, but now we want to stack notifications in the notifications page, in API responses and in email bundles.
14 lines
310 B
Ruby
14 lines
310 B
Ruby
module PushNotifiable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
after_create_commit :push_notification_later
|
|
after_update_commit :push_notification_later, if: :source_id_previously_changed?
|
|
end
|
|
|
|
private
|
|
def push_notification_later
|
|
PushNotificationJob.perform_later(self)
|
|
end
|
|
end
|