Use the `GroupProjectsFinder` to find direct children

This commit is contained in:
Bob Van Landuyt 2017-10-10 17:05:02 +02:00
parent b9c12be5b9
commit e678f31292
1 changed files with 5 additions and 4 deletions

View File

@ -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