diff options
Diffstat (limited to 'app/finders/labels_finder.rb')
-rw-r--r-- | app/finders/labels_finder.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/finders/labels_finder.rb b/app/finders/labels_finder.rb index e726772fba4..4358cf249f7 100644 --- a/app/finders/labels_finder.rb +++ b/app/finders/labels_finder.rb @@ -172,7 +172,14 @@ class LabelsFinder < UnionFinder ProjectsFinder.new(params: { non_archived: true }, current_user: current_user).execute # rubocop: disable CodeReuse/Finder end - @projects = @projects.in_namespace(group.id) if group? + if group? + @projects = if params[:include_subgroups] + @projects.in_namespace(group.self_and_descendants.select(:id)) + else + @projects.in_namespace(group.id) + end + end + @projects = @projects.where(id: params[:project_ids]) if projects? @projects = @projects.reorder(nil) |