From 20a08965bc949ea233cdde4e777698222fcabff2 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Thu, 14 Sep 2017 11:53:55 +0200 Subject: [WIP] improve number of queries when rendering a hierarchy --- app/finders/group_children_finder.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/finders') diff --git a/app/finders/group_children_finder.rb b/app/finders/group_children_finder.rb index 6e2e2dfa5a1..430373a92a2 100644 --- a/app/finders/group_children_finder.rb +++ b/app/finders/group_children_finder.rb @@ -38,7 +38,7 @@ class GroupChildrenFinder private def children - @children ||= subgroups + projects + @children ||= subgroups.with_route.includes(:route, :parent) + projects.with_route.includes(:route, :namespace) end def base_groups @@ -64,7 +64,7 @@ class GroupChildrenFinder else base_groups end - groups.sort(params[:sort]).includes(:route) + groups.sort(params[:sort]) end def base_projects @@ -85,6 +85,6 @@ class GroupChildrenFinder else base_projects end - projects.sort(params[:sort]).includes(:route, :namespace) + projects.sort(params[:sort]) end end -- cgit v1.2.1