From d81c646014a112d15b0510a58ef74a28fd55f125 Mon Sep 17 00:00:00 2001 From: Gabriel Mazetto Date: Wed, 14 Nov 2018 04:15:17 +0100 Subject: [PATCH] Eager-load relations for Explore::ProjectsController This removes remaining N+1 queries --- app/controllers/explore/projects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/explore/projects_controller.rb b/app/controllers/explore/projects_controller.rb index 7ecbc32cf4e..778fdda8dbd 100644 --- a/app/controllers/explore/projects_controller.rb +++ b/app/controllers/explore/projects_controller.rb @@ -57,7 +57,7 @@ class Explore::ProjectsController < Explore::ApplicationController def load_projects projects = ProjectsFinder.new(current_user: current_user, params: params) .execute - .includes(:route, namespace: :route) + .includes(:route, :creator, :group, namespace: [:route, :owner]) .page(params[:page]) .without_count