Merge pull request #475 from basecamp/flavorjones/turbo-readings

Broadcast notification readings
This commit is contained in:
Mike Dalessio
2025-05-08 10:50:31 -04:00
committed by GitHub
+5
View File
@@ -17,6 +17,7 @@ class Notification < ApplicationRecord
def read
update!(read_at: Time.current)
broadcast_read
end
def read?
@@ -27,4 +28,8 @@ class Notification < ApplicationRecord
def broadcast_unread
broadcast_prepend_later_to user, :notifications, target: "notifications"
end
def broadcast_read
broadcast_remove_to user, :notifications
end
end