Include nested groups items into search results

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2017-01-26 21:33:27 +02:00
parent 15ad1d8815
commit d6febcaf3e

View file

@ -9,7 +9,11 @@ module Search
def execute
group = Group.find_by(id: params[:group_id]) if params[:group_id].present?
projects = ProjectsFinder.new.execute(current_user)
projects = projects.in_namespace(group.id) if group
if group
ids = group.descendants.push(group.id)
projects = projects.in_namespace(ids)
end
Gitlab::SearchResults.new(current_user, projects, params[:search])
end