Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
app/serializers/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
...
@@ -6,10 +6,10 @@ class GroupChildSerializer < BaseSerializer
entity
GroupChildEntity
entity
GroupChildEntity
def
expand_hierarchy
(
hierarchy_root
=
nil
)
def
expand_hierarchy
(
hierarchy_root
=
nil
)
tap
do
@hierarchy_root
=
hierarchy_root
@hierarchy_root
=
hierarchy_root
@should_expand_hierarchy
=
true
@should_expand_hierarchy
=
true
end
self
end
end
def
represent
(
resource
,
opts
=
{},
entity_class
=
nil
)
def
represent
(
resource
,
opts
=
{},
entity_class
=
nil
)
...
@@ -41,7 +41,7 @@ class GroupChildSerializer < BaseSerializer
...
@@ -41,7 +41,7 @@ class GroupChildSerializer < BaseSerializer
.
merge
(
children:
Array
.
wrap
(
serializer
.
represent_hierarchy
(
children
,
opts
)))
.
merge
(
children:
Array
.
wrap
(
serializer
.
represent_hierarchy
(
children
,
opts
)))
end
end
elsif
hierarchy
.
is_a?
(
Array
)
elsif
hierarchy
.
is_a?
(
Array
)
hierarchy
.
map
{
|
child
|
serializer
.
represent_hierarchy
(
child
,
opts
)
}.
flatten
hierarchy
.
flat_map
{
|
child
|
serializer
.
represent_hierarchy
(
child
,
opts
)
}
else
else
serializer
.
represent
(
hierarchy
,
opts
)
serializer
.
represent
(
hierarchy
,
opts
)
end
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