BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e55886b3
Commit
e55886b3
authored
Oct 10, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return `self` from `GroupChildSerializer#expand_hierarchy`
parent
9d1348d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
group_child_serializer.rb
app/serializers/group_child_serializer.rb
+5
-5
No files found.
app/serializers/group_child_serializer.rb
View file @
e55886b3
...
...
@@ -6,10 +6,10 @@ class GroupChildSerializer < BaseSerializer
entity
GroupChildEntity
def
expand_hierarchy
(
hierarchy_root
=
nil
)
tap
do
@hierarchy_root
=
hierarchy_root
@should_expand_hierarchy
=
true
end
@hierarchy_root
=
hierarchy_root
@should_expand_hierarchy
=
true
self
end
def
represent
(
resource
,
opts
=
{},
entity_class
=
nil
)
...
...
@@ -41,7 +41,7 @@ class GroupChildSerializer < BaseSerializer
.
merge
(
children:
Array
.
wrap
(
serializer
.
represent_hierarchy
(
children
,
opts
)))
end
elsif
hierarchy
.
is_a?
(
Array
)
hierarchy
.
map
{
|
child
|
serializer
.
represent_hierarchy
(
child
,
opts
)
}.
flatten
hierarchy
.
flat_map
{
|
child
|
serializer
.
represent_hierarchy
(
child
,
opts
)
}
else
serializer
.
represent
(
hierarchy
,
opts
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment