about summary refs log tree commit diff
diff options
context:
space:
mode:
authornametoolong <nametoolong@users.noreply.github.com>2022-12-15 23:18:20 +0800
committerGitHub <noreply@github.com>2022-12-15 16:18:20 +0100
commit63b379c2d95a8ea7127f2621603037cc9013870d (patch)
tree47d3e9da9d365c96cdb81f45f4f76642f13fd19e
parent596923da4a4a0e384da5abeb0d987c127301630a (diff)
Fix N+1 queries from in NotificationsController (#21202)
Co-authored-by: Nonexistent <nx@example.org>
-rw-r--r--app/controllers/api/v1/notifications_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb
index 6d464997e..7b1cfe264 100644
--- a/app/controllers/api/v1/notifications_controller.rb
+++ b/app/controllers/api/v1/notifications_controller.rb
@@ -31,7 +31,7 @@ class Api::V1::NotificationsController < Api::BaseController
   private
 
   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),
       params_slice(:max_id, :since_id, :min_id)
     )