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
eecd2102
Commit
eecd2102
authored
Jun 13, 2017
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better exception message and some additional code comment
parent
ef1811f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
lib/gitlab/group_hierarchy.rb
lib/gitlab/group_hierarchy.rb
+3
-1
No files found.
lib/gitlab/group_hierarchy.rb
View file @
eecd2102
...
...
@@ -10,7 +10,7 @@ module Gitlab
# descendants_base - An instance of ActiveRecord::Relation for which to
# get child groups. If omitted, ancestors_base is used.
def
initialize
(
ancestors_base
,
descendants_base
=
ancestors_base
)
raise
ArgumentError
if
ancestors_base
.
model
!=
descendants_base
.
model
raise
ArgumentError
.
new
(
"Model of ancestors_base does not match model of descendants_base"
)
if
ancestors_base
.
model
!=
descendants_base
.
model
@ancestors_base
=
ancestors_base
@descendants_base
=
descendants_base
...
...
@@ -53,6 +53,8 @@ module Gitlab
#
# Using this approach allows us to further add criteria to the relation with
# Rails thinking it's selecting data the usual way.
#
# If nested groups are not supported, ancestors_base is returned.
def
all_groups
return
ancestors_base
unless
Group
.
supports_nested_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