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
a157d0c039ee
Commit
e13753fc
authored
Sep 21, 2017
by
Bob Van Landuyt
Browse files
Only take unarchived projects into account
When finding children for a group
parent
48d35c4e84de
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/finders/group_descendants_finder.rb
View file @
a157d0c0
...
...
@@ -6,7 +6,7 @@ class GroupDescendantsFinder
def
initialize
(
current_user:
nil
,
parent_group
:,
params:
{})
@current_user
=
current_user
@parent_group
=
parent_group
@params
=
params
@params
=
params
.
reverse_merge
(
non_archived:
true
)
end
def
execute
...
...
@@ -74,7 +74,7 @@ def direct_child_projects
end
def
projects_matching_filter
ProjectsFinder
.
new
(
current_user:
current_user
).
execute
ProjectsFinder
.
new
(
current_user:
current_user
,
params:
params
).
execute
.
search
(
params
[
:filter
])
.
where
(
namespace:
all_descendant_groups
)
end
...
...
spec/finders/group_descendants_finder_spec.rb
View file @
a157d0c0
...
...
@@ -19,6 +19,12 @@
expect
(
finder
.
execute
).
to
contain_exactly
(
project
)
end
it
'does not include archived projects'
do
_archived_project
=
create
(
:project
,
:archived
,
namespace:
group
)
expect
(
finder
.
execute
).
to
be_empty
end
context
'with a filter'
do
let
(
:params
)
{
{
filter:
'test'
}
}
...
...
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