Files
fizzy/app/models/notification/push_target/web.rb
T
Rosa Gutierrez 7864748be9 Simplify PushTarget by removing template method pattern
Each target now implements process directly with its own logic,
rather than using processable?/perform_push hooks. The pushable?
check is done once in Notification#push before iterating targets.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 19:31:13 +01:00

13 lines
314 B
Ruby

class Notification::PushTarget::Web < Notification::PushTarget
def process
if subscriptions.any?
Rails.configuration.x.web_push_pool.queue(notification.payload.to_h, subscriptions)
end
end
private
def subscriptions
@subscriptions ||= notification.user.push_subscriptions
end
end