BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6388b8fe
Commit
6388b8fe
authored
Sep 10, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't include the parent in search results if it matches
parent
79cc3c8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
group_children_finder.rb
app/finders/group_children_finder.rb
+1
-1
group_children_finder_spec.rb
spec/finders/group_children_finder_spec.rb
+6
-0
No files found.
app/finders/group_children_finder.rb
View file @
6388b8fe
...
...
@@ -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
...
...
spec/finders/group_children_finder_spec.rb
View file @
6388b8fe
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment