summaryrefslogtreecommitdiff
path: root/app/serializers/group_child_serializer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/group_child_serializer.rb')
-rw-r--r--app/serializers/group_child_serializer.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/serializers/group_child_serializer.rb b/app/serializers/group_child_serializer.rb
index 6d0e67a37cd..2baef0a5703 100644
--- a/app/serializers/group_child_serializer.rb
+++ b/app/serializers/group_child_serializer.rb
@@ -28,7 +28,9 @@ class GroupChildSerializer < BaseSerializer
represent_hierarchy(children.hierarchy(hierarchy_root), opts).first
else
hierarchies = GroupDescendant.build_hierarchy(children, hierarchy_root)
- represent_hierarchy(hierarchies, opts)
+ # When an array was passed, we always want to represent an array.
+ # Even if the hierarchy only contains one element
+ represent_hierarchy(Array.wrap(hierarchies), opts)
end
end