Skip to content

Commit 32ef95d

Browse files
committed
refactor: rename notification marking method for consistency and clarity
1 parent 1332c0a commit 32ef95d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/developers/systems/notifications_system.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Notifications System Overview
22

3-
This document explains how notifications are produced, delivered, deduplicated, and marked as read across the app. The system uses the Noticed gem with Action Cable and email channels.
3+
This document explains how notifications are produced, delivered, deduplicated, - Concern: `BetterTogether::NotificationReadable` (`app/controllers/concerns/better_together/notification_readable.rb`)
4+
- `mark_notifications_read_for_record_id(record_id)`: generic record-based read marker using `noticed_events.record_id`.
5+
- `mark_notifications_read_for_event_records(event_class, record_ids)`: batch mark for a specific Noticed event type and list of record IDs.
6+
- `mark_match_notifications_read_for(record)`: efficiently marks unread `MatchNotifier` notifications for an Offer/Request by matching the record's GlobalID in `params`.marked as read across the app. The system uses the Noticed gem with Action Cable and email channels.
47

58
## Process Flow Diagram
69

spec/controllers/concerns/notification_readable_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
end
3333
end
3434

35-
describe '#mark_notifications_read_for_record' do
35+
describe '#mark_notifications_read_for_record_id' do
3636
# rubocop:todo RSpec/MultipleExpectations
3737
it 'marks unread notifications tied to the event record as read' do # rubocop:todo RSpec/ExampleLength, RSpec/MultipleExpectations
3838
# rubocop:enable RSpec/MultipleExpectations
@@ -48,7 +48,7 @@
4848
.where(noticed_events: { type: 'BetterTogether::NewMessageNotifier' }).count
4949
expect(unread_before).to be >= 1
5050

51-
concern_host.mark_notifications_read_for_record(message, recipient:)
51+
concern_host.mark_notifications_read_for_record_id(message.id, recipient:)
5252

5353
unread_after = recipient.notifications.unread.joins(:event)
5454
.where(noticed_events: { type: 'BetterTogether::NewMessageNotifier' }).count

0 commit comments

Comments
 (0)