2
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
9 changed files with 57 additions and 40 deletions

View File

@@ -9,12 +9,13 @@
# from_account_id :bigint(8) not null
# last_status_id :bigint(8)
# notifications_count :bigint(8) default(0), not null
# dismissed :boolean default(FALSE), not null
# created_at :datetime not null
# updated_at :datetime not null
#
class NotificationRequest < ApplicationRecord
self.ignored_columns += %w(dismissed)
include Paginable
MAX_MEANINGFUL_COUNT = 100
@@ -34,8 +35,6 @@ class NotificationRequest < ApplicationRecord
end
def reconsider_existence!
return if dismissed?
prepare_notifications_count
if notifications_count.positive?