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
75969000
Commit
75969000
authored
Sep 29, 2020
by
Eugenia Grieff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use existing Namespace method descendants
parent
0ad0ccd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
app/finders/groups_finder.rb
app/finders/groups_finder.rb
+3
-5
No files found.
app/finders/groups_finder.rb
View file @
75969000
...
...
@@ -12,7 +12,8 @@
# all_available: boolean (defaults to true)
# min_access_level: integer
# exclude_group_ids: array of integers
# include_parent_descendants: boolean (defaults to false)
# include_parent_descendants: boolean (defaults to false) - includes descendant groups when
# filtering by parent. The parent param must be present.
#
# Users with full private access can see all groups. The `owned` and `parent`
# params can be used to restrict the groups that are returned.
...
...
@@ -86,10 +87,7 @@ class GroupsFinder < UnionFinder
return
groups
unless
params
[
:parent
]
if
include_parent_descendants?
descendants
=
Gitlab
::
ObjectHierarchy
.
new
(
groups
.
where
(
id:
params
[
:parent
]))
.
descendants
groups
.
id_in
(
descendants
)
groups
.
id_in
(
params
[
:parent
].
descendants
)
else
groups
.
where
(
parent:
params
[
:parent
])
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