From fdbc41df8ea7591ec7da9759a97c6ebe0c1046a0 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Tue, 7 Jul 2026 03:53:04 -0400 Subject: [PATCH] Fix N+1 queries when rendering accounts on the admin collection page (#39738) Co-authored-by: Claude Fable 5 --- app/controllers/admin/collections_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/collections_controller.rb b/app/controllers/admin/collections_controller.rb index 405c779e3d4..6427016eea2 100644 --- a/app/controllers/admin/collections_controller.rb +++ b/app/controllers/admin/collections_controller.rb @@ -51,7 +51,7 @@ module Admin end def set_collection - @collection = @account.collections.includes(accepted_collection_items: :account).find(params[:id]) + @collection = @account.collections.includes(accepted_collection_items: { account: [:account_stat, user: [:ips, :invite_request]] }).find(params[:id]) end def set_collections