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
9d54da23
Commit
9d54da23
authored
Oct 10, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse `base_and_ancestors` for `ancestors` in `GroupHierarchy`
parent
e55886b3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
lib/gitlab/group_hierarchy.rb
lib/gitlab/group_hierarchy.rb
+1
-2
No files found.
lib/gitlab/group_hierarchy.rb
View file @
9d54da23
...
...
@@ -30,8 +30,7 @@ module Gitlab
# reached. So all ancestors *lower* than the specified ancestor will be
# included.
def
ancestors
(
upto:
nil
)
read_only
(
base_and_ancestors_cte
(
upto
).
apply_to
(
model
.
all
))
.
where
.
not
(
id:
ancestors_base
.
select
(
:id
))
base_and_ancestors
(
upto:
upto
).
where
.
not
(
id:
ancestors_base
.
select
(
:id
))
end
# Returns a relation that includes the ancestors_base set of groups
...
...
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