Eager-load relations for Explore::ProjectsController

This removes remaining N+1 queries
This commit is contained in:
Gabriel Mazetto 2018-11-14 04:15:17 +01:00
parent 3e1227e7f5
commit d81c646014
1 changed files with 1 additions and 1 deletions

View File

@ -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