Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-09-22 16:34:22 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-04 23:49:41 +0300
commitee2744c60db2e7d8a7e35fbc62c6d236c5ba2d0a (patch)
treeaed712b25da0e08117215100fa7547eb7aa58678 /app/serializers
parente13753fcaa4901a840f6b33bf9e1a06185c3ba10 (diff)
Don't wrap arrays twice: `children` are already wrapped in an array
We do the wrapping in an array in represent_hierarchy for children.
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/group_child_serializer.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/group_child_serializer.rb b/app/serializers/group_child_serializer.rb
index 1b6b2ad6e08..f2ec741d32c 100644
--- a/app/serializers/group_child_serializer.rb
+++ b/app/serializers/group_child_serializer.rb
@@ -27,8 +27,8 @@ class GroupChildSerializer < BaseSerializer
if children.is_a?(GroupDescendant)
represent_hierarchy(children.hierarchy(hierarchy_root), opts).first
else
- hierarchies = Array.wrap(GroupDescendant.merge_hierarchies(children, hierarchy_root))
- hierarchies.map { |hierarchy| represent_hierarchy(hierarchy, opts) }.flatten
+ hierarchies = GroupDescendant.merge_hierarchies(children, hierarchy_root)
+ represent_hierarchy(hierarchies, opts)
end
end