Files
fizzy/app/models/concerns/push_notifiable.rb
T
Stanko K.R. 36ee253a1a Stack notifications everywhere
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.
2026-02-12 10:29:50 +01:00

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