diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-10 17:05:02 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-10 17:05:02 +0200 |
commit | e678f312923faf9a702e19894175d4cb14f66b5b (patch) | |
tree | 1b5aab31a403cf1742aa4c894b6a72e032f65f5e /app | |
parent | b9c12be5b932245a0c7e77b953c20ef379f0ef94 (diff) | |
download | gitlab-ce-e678f312923faf9a702e19894175d4cb14f66b5b.tar.gz |
Use the `GroupProjectsFinder` to find direct children
Diffstat (limited to 'app')
-rw-r--r-- | app/finders/group_descendants_finder.rb | 9 |
1 files 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 |