0
0
Fork 0

Destroy NotificationRequests that are dismissed (#31008)

This commit is contained in:
David Roetzel 2024-07-12 14:09:52 +02:00 committed by GitHub
parent c929b4cace
commit 35a437a03f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 57 additions and 40 deletions

View file

@ -31,6 +31,6 @@ class NotificationPolicy < ApplicationRecord
private
def pending_notification_requests
@pending_notification_requests ||= notification_requests.where(dismissed: false).limit(MAX_MEANINGFUL_COUNT).pick(Arel.sql('count(*), coalesce(sum(notifications_count), 0)::bigint'))
@pending_notification_requests ||= notification_requests.limit(MAX_MEANINGFUL_COUNT).pick(Arel.sql('count(*), coalesce(sum(notifications_count), 0)::bigint'))
end
end