diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-09-14 11:53:55 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-04 22:49:41 +0200 |
commit | 20a08965bc949ea233cdde4e777698222fcabff2 (patch) | |
tree | 681a0c40cf5148fa227081fc02fd27028d96b50e /app | |
parent | ea4e17e2aec525f249430b0a22dc6a8450648837 (diff) | |
download | gitlab-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.rb | 6 |
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 |