Eager-load relations for Explore::ProjectsController
This removes remaining N+1 queries
This commit is contained in:
parent
3e1227e7f5
commit
d81c646014
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue