Commit bd08fff6 authored by Yorick Peterse's avatar Yorick Peterse

Eager load project creators for project dashboards

This solves an N+1 query problem where for every project we'd query the
creator separately just to figure out what avatar to display.
parent ab738645
......@@ -45,8 +45,10 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
end
def load_projects(finder_params)
ProjectsFinder.new(params: finder_params, current_user: current_user)
.execute.includes(:route, namespace: :route)
ProjectsFinder
.new(params: finder_params, current_user: current_user)
.execute
.includes(:route, :creator, namespace: :route)
end
def load_events
......
---
title: Eager load project creators for project dashboards
merge_request:
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment