mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-27 23:55:52 +00:00
Speed up check of notification request validity.
No need to load full account records here.
This commit is contained in:
parent
584b1524dd
commit
6c76502527
|
@ -47,6 +47,6 @@ class NotificationRequest < ApplicationRecord
|
||||||
private
|
private
|
||||||
|
|
||||||
def prepare_notifications_count
|
def prepare_notifications_count
|
||||||
self.notifications_count = Notification.where(account: account, from_account: from_account, filtered: true).limit(MAX_MEANINGFUL_COUNT).count
|
self.notifications_count = Notification.where(account_id: account_id, from_account_id: from_account_id, filtered: true).limit(MAX_MEANINGFUL_COUNT).count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue