Commit fb7a0f8c authored by Bob Van Landuyt's avatar Bob Van Landuyt

More descriptive method names for projects & groups

parent 31f77568
...@@ -41,14 +41,14 @@ class GroupChildrenFinder ...@@ -41,14 +41,14 @@ class GroupChildrenFinder
@children ||= subgroups.with_route.includes(:route, :parent) + projects.with_route.includes(:route, :namespace) @children ||= subgroups.with_route.includes(:route, :parent) + projects.with_route.includes(:route, :namespace)
end end
def base_groups def direct_subgroups
GroupsFinder.new(current_user, GroupsFinder.new(current_user,
parent: parent_group, parent: parent_group,
all_available: true).execute all_available: true).execute
end end
def all_subgroups def all_subgroups
Gitlab::GroupHierarchy.new(Group.where(id: parent_group)).all_groups Gitlab::GroupHierarchy.new(Group.where(id: parent_group)).base_and_descendants
end end
def subgroups_matching_filter def subgroups_matching_filter
...@@ -62,12 +62,12 @@ class GroupChildrenFinder ...@@ -62,12 +62,12 @@ class GroupChildrenFinder
groups = if params[:filter] groups = if params[:filter]
subgroups_matching_filter subgroups_matching_filter
else else
base_groups direct_subgroups
end end
groups.sort(params[:sort]) groups.sort(params[:sort])
end end
def base_projects def direct_child_projects
GroupProjectsFinder.new(group: parent_group, params: params, current_user: current_user).execute GroupProjectsFinder.new(group: parent_group, params: params, current_user: current_user).execute
end end
...@@ -83,7 +83,7 @@ class GroupChildrenFinder ...@@ -83,7 +83,7 @@ class GroupChildrenFinder
projects = if params[:filter] projects = if params[:filter]
projects_matching_filter projects_matching_filter
else else
base_projects direct_child_projects
end end
projects.sort(params[:sort]) projects.sort(params[:sort])
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment