Update grouped_notifications_presenter.rb

listened to cop
This commit is contained in:
Shlee 2025-12-23 01:09:11 +10:30 committed by GitHub
parent aa6b37bd07
commit 458c95b6ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,7 @@ class GroupedNotificationsPresenter < ActiveModelSerializers::Model
def accounts
@accounts ||= begin
if partial_avatars?
@grouped_notifications.map { |group| group.sample_accounts.first }.compact.uniq(&:id)
@grouped_notifications.filter_map { |group| group.sample_accounts.first }.uniq(&:id)
else
@grouped_notifications.flat_map(&:sample_accounts).compact.uniq(&:id)
end