Fix N+1 queries from in NotificationsController (#21202)

Co-authored-by: Nonexistent <nx@example.org>
lolsob-rspec
nametoolong 2022-12-15 23:18:20 +08:00 committed by GitHub
parent 11b7735fb3
commit 93ad2aba5e
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ class Api::V1::NotificationsController < Api::BaseController
private private
def load_notifications def load_notifications
notifications = browserable_account_notifications.includes(from_account: :account_stat).to_a_paginated_by_id( notifications = browserable_account_notifications.includes(from_account: [:account_stat, :user]).to_a_paginated_by_id(
limit_param(DEFAULT_NOTIFICATIONS_LIMIT), limit_param(DEFAULT_NOTIFICATIONS_LIMIT),
params_slice(:max_id, :since_id, :min_id) params_slice(:max_id, :since_id, :min_id)
) )