From e678f312923faf9a702e19894175d4cb14f66b5b Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Tue, 10 Oct 2017 17:05:02 +0200 Subject: Use the `GroupProjectsFinder` to find direct children --- app/finders/group_descendants_finder.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/finders/group_descendants_finder.rb b/app/finders/group_descendants_finder.rb index be22b6ef79a..ea7974eb882 100644 --- a/app/finders/group_descendants_finder.rb +++ b/app/finders/group_descendants_finder.rb @@ -99,12 +99,13 @@ class GroupDescendantsFinder groups.with_selects_for_list.order_by(sort) end - def projects_for_user - Project.public_or_visible_to_user(current_user).non_archived + def direct_child_projects + GroupProjectsFinder.new(group: parent_group, current_user: current_user, params: params) + .execute end - def direct_child_projects - projects_for_user.where(namespace: parent_group) + def projects_for_user + Project.public_or_visible_to_user(current_user).non_archived end # Finds all projects nested under `parent_group` or any of its descendant -- cgit v1.2.1