diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-09-22 15:34:22 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-04 22:49:41 +0200 |
commit | ee2744c60db2e7d8a7e35fbc62c6d236c5ba2d0a (patch) | |
tree | aed712b25da0e08117215100fa7547eb7aa58678 /app/serializers | |
parent | e13753fcaa4901a840f6b33bf9e1a06185c3ba10 (diff) | |
download | gitlab-ce-ee2744c60db2e7d8a7e35fbc62c6d236c5ba2d0a.tar.gz |
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.rb | 4 |
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 |