Skip to content
Snippets Groups Projects
Commit 6388b8fe authored by Bob Van Landuyt's avatar Bob Van Landuyt
Browse files

Don't include the parent in search results if it matches

parent 79cc3c8e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -52,7 +52,7 @@ class GroupChildrenFinder
end
 
def subgroups_matching_filter
all_subgroups.search(params[:filter])
all_subgroups.where.not(id: parent_group).search(params[:filter])
end
 
def subgroups
Loading
Loading
Loading
Loading
@@ -60,6 +60,12 @@ describe GroupChildrenFinder do
 
expect(finder.execute).to contain_exactly(matching_project)
end
it 'does not include the parent itself' do
group.update!(name: 'test')
expect(finder.execute).not_to include(group)
end
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment