Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
1e4e51816043
Commit
1e4e5181
authored
Sep 19, 2017
by
Bob Van Landuyt
Browse files
More descriptive method names for projects & groups
parent
d4830ba06b8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/finders/group_children_finder.rb
View file @
1e4e5181
...
...
@@ -41,10 +41,10 @@
@children
||=
subgroups
.
with_route
.
includes
(
:route
,
:parent
)
+
projects
.
with_route
.
includes
(
:route
,
:namespace
)
end
def
base_
groups
def
direct_sub
groups
GroupsFinder
.
new
(
current_user
,
parent:
parent_group
,
all_available:
true
).
execute
end
def
all_subgroups
...
...
@@ -45,10 +45,10 @@
GroupsFinder
.
new
(
current_user
,
parent:
parent_group
,
all_available:
true
).
execute
end
def
all_subgroups
Gitlab
::
GroupHierarchy
.
new
(
Group
.
where
(
id:
parent_group
)).
all_group
s
Gitlab
::
GroupHierarchy
.
new
(
Group
.
where
(
id:
parent_group
)).
base_and_descendant
s
end
def
subgroups_matching_filter
...
...
@@ -62,8 +62,8 @@
groups
=
if
params
[
:filter
]
subgroups_matching_filter
else
base_
groups
direct_sub
groups
end
groups
.
sort
(
params
[
:sort
])
end
...
...
@@ -66,8 +66,8 @@
end
groups
.
sort
(
params
[
:sort
])
end
def
base
_projects
def
direct_child
_projects
GroupProjectsFinder
.
new
(
group:
parent_group
,
params:
params
,
current_user:
current_user
).
execute
end
...
...
@@ -83,7 +83,7 @@
projects
=
if
params
[
:filter
]
projects_matching_filter
else
base
_projects
direct_child
_projects
end
projects
.
sort
(
params
[
:sort
])
end
...
...
Write
Preview
Supports
Markdown
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