summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-09-26 14:12:12 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-04 22:49:42 +0200
commitb92e7103fcced2d62000ed382848219016484f7b (patch)
tree7da435862146503eda545e4f4942884641341628 /app
parentac0b104ae4968adaed7b94db76c0ac86badb6d6b (diff)
downloadgitlab-ce-b92e7103fcced2d62000ed382848219016484f7b.tar.gz
Fix nesting bug when rendering children of a shared subgroup
Diffstat (limited to 'app')
-rw-r--r--app/finders/group_descendants_finder.rb2
-rw-r--r--app/serializers/group_child_serializer.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/finders/group_descendants_finder.rb b/app/finders/group_descendants_finder.rb
index 07178a026e8..4ed9c0ea39a 100644
--- a/app/finders/group_descendants_finder.rb
+++ b/app/finders/group_descendants_finder.rb
@@ -64,7 +64,7 @@ class GroupDescendantsFinder
subgroups_with_counts = ancestors_for_project_search.with_route.select(group_selects) | subgroups_with_counts
end
- @children = subgroups_with_counts + projects.preload(:route)
+ @children = subgroups_with_counts + projects.with_route
end
def direct_child_groups
diff --git a/app/serializers/group_child_serializer.rb b/app/serializers/group_child_serializer.rb
index ba81f99fff4..6fa269ee5c0 100644
--- a/app/serializers/group_child_serializer.rb
+++ b/app/serializers/group_child_serializer.rb
@@ -41,7 +41,7 @@ class GroupChildSerializer < BaseSerializer
.merge(children: Array.wrap(serializer.represent_hierarchy(children, opts)))
end
elsif hierarchy.is_a?(Array)
- hierarchy.map { |child| serializer.represent_hierarchy(child, opts) }
+ hierarchy.map { |child| serializer.represent_hierarchy(child, opts) }.flatten
else
serializer.represent(hierarchy, opts)
end