Commit d6febcaf authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Include nested groups items into search results

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 15ad1d88
...@@ -9,7 +9,11 @@ module Search ...@@ -9,7 +9,11 @@ module Search
def execute def execute
group = Group.find_by(id: params[:group_id]) if params[:group_id].present? group = Group.find_by(id: params[:group_id]) if params[:group_id].present?
projects = ProjectsFinder.new.execute(current_user) 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]) Gitlab::SearchResults.new(current_user, projects, params[:search])
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