From 2ced8e643d71bb24658a8c1b616af3e14092392a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 16 Apr 2025 17:01:32 +0200 Subject: [PATCH] Clarify a bit --- app/models/notification.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index e6a32ef3c..9fbb94a5b 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -9,7 +9,7 @@ class Notification < ApplicationRecord scope :ordered, -> { order(read_at: :desc, created_at: :desc) } delegate :creator, to: :event - after_create_commit :broadcast + after_create_commit :broadcast_unread def self.read_all update!(read_at: Time.current) @@ -24,7 +24,7 @@ class Notification < ApplicationRecord end private - def broadcast + def broadcast_unread broadcast_prepend_later_to user, :notifications, target: "notifications" end end