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
Show 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 @@
...
@@ -12,7 +12,8 @@
# all_available: boolean (defaults to true)
# all_available: boolean (defaults to true)
# min_access_level: integer
# min_access_level: integer
# exclude_group_ids: array of integers
# 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`
# Users with full private access can see all groups. The `owned` and `parent`
# params can be used to restrict the groups that are returned.
# params can be used to restrict the groups that are returned.
...
@@ -86,10 +87,7 @@ class GroupsFinder < UnionFinder
...
@@ -86,10 +87,7 @@ class GroupsFinder < UnionFinder
return
groups
unless
params
[
:parent
]
return
groups
unless
params
[
:parent
]
if
include_parent_descendants?
if
include_parent_descendants?
descendants
=
Gitlab
::
ObjectHierarchy
groups
.
id_in
(
params
[
:parent
].
descendants
)
.
new
(
groups
.
where
(
id:
params
[
:parent
]))
.
descendants
groups
.
id_in
(
descendants
)
else
else
groups
.
where
(
parent:
params
[
:parent
])
groups
.
where
(
parent:
params
[
:parent
])
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