Commit ee2744c6 authored by Bob Van Landuyt's avatar Bob Van Landuyt
Browse files

Don't wrap arrays twice: `children` are already wrapped in an array

We do the wrapping in an array in represent_hierarchy for children.
parent a157d0c039ee
......@@ -27,8 +27,8 @@ def represent_hierarchies(children, opts)
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment