Change dismissing a notification to clear existing filtered notifications for that account (#31329)

This commit is contained in:
Claire 2024-08-07 17:14:37 +02:00 committed by GitHub
parent 6f285bb2a6
commit 670e4655d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 1 deletions

View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
class FilteredNotificationCleanupWorker
include Sidekiq::Worker
def perform(account_id, from_account_id)
Notification.where(account_id: account_id, from_account_id: from_account_id, filtered: true).reorder(nil).in_batches(order: :desc).delete_all
end
end