Merge remote-tracking branch 'parent/main' into upstream-20240806
This commit is contained in:
commit
8e5fe5ccb9
166 changed files with 2268 additions and 1390 deletions
21
app/presenters/grouped_notifications_presenter.rb
Normal file
21
app/presenters/grouped_notifications_presenter.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class GroupedNotificationsPresenter < ActiveModelSerializers::Model
|
||||
def initialize(grouped_notifications)
|
||||
super()
|
||||
|
||||
@grouped_notifications = grouped_notifications
|
||||
end
|
||||
|
||||
def notification_groups
|
||||
@grouped_notifications
|
||||
end
|
||||
|
||||
def statuses
|
||||
@grouped_notifications.filter_map(&:target_status).uniq(&:id)
|
||||
end
|
||||
|
||||
def accounts
|
||||
@grouped_notifications.flat_map(&:sample_accounts).uniq(&:id)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue