Don't wrap arrays twice: children
are already wrapped in an array
We do the wrapping in an array in represent_hierarchy for children.
This commit is contained in:
parent
e13753fcaa
commit
ee2744c60d
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue