summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-09-14 11:53:55 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-04 22:49:41 +0200
commit20a08965bc949ea233cdde4e777698222fcabff2 (patch)
tree681a0c40cf5148fa227081fc02fd27028d96b50e /app
parentea4e17e2aec525f249430b0a22dc6a8450648837 (diff)
downloadgitlab-ce-20a08965bc949ea233cdde4e777698222fcabff2.tar.gz
[WIP] improve number of queries when rendering a hierarchy
Diffstat (limited to 'app')
-rw-r--r--app/finders/group_children_finder.rb6
1 files changed, 3 insertions, 3 deletions
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