Skip to content

Mark A Group Of Notifications As Read

Sean C Davis edited this page Sep 5, 2016 · 1 revision

You can mark a group of notifications as read all at once using the recipient and trigger(s) through the NotifyOn::Notification.mark_read_for method.

For example, say we have a @chat object that has many messages, and we want to mark them all read for the current_user. We can do this:

NotifyOn::Notification.mark_read_for(current_user, @chat.messages)