summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-09-11 16:05:14 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2017-09-11 16:18:59 +0200
commit615ba0071a8bcd3da93f6c27e45128af865cc7bb (patch)
treeae9b090f896889e01ce9e0947456e59b361e2c52 /app/controllers/dashboard
parent5cc140b202a0fc9bf2056b481c977bbcf9255919 (diff)
downloadgitlab-ce-615ba0071a8bcd3da93f6c27e45128af865cc7bb.tar.gz
Eager load namespace owners for project dashboardsdashboards-projects-controller
This solves an N+1 query problem where we'd run multiple queries when getting the namespace owners of the displayed projects.
Diffstat (limited to 'app/controllers/dashboard')
-rw-r--r--app/controllers/dashboard/projects_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/dashboard/projects_controller.rb b/app/controllers/dashboard/projects_controller.rb
index f71ab702e71..cd94a36a6e7 100644
--- a/app/controllers/dashboard/projects_controller.rb
+++ b/app/controllers/dashboard/projects_controller.rb
@@ -48,7 +48,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
ProjectsFinder
.new(params: finder_params, current_user: current_user)
.execute
- .includes(:route, :creator, namespace: :route)
+ .includes(:route, :creator, namespace: [:route, :owner])
end
def load_events