Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ee6eb923
Commit
ee6eb923
authored
Apr 05, 2019
by
Igor
Committed by
Douwe Maan
Apr 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sorting by priority with filtering by approvers
parent
dc832011
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
ee/app/models/ee/merge_request.rb
ee/app/models/ee/merge_request.rb
+1
-1
ee/changelogs/unreleased/id-500-filter-by-approver-and-priority.yml
...ogs/unreleased/id-500-filter-by-approver-and-priority.yml
+5
-0
ee/spec/finders/merge_requests/by_approvers_finder_spec.rb
ee/spec/finders/merge_requests/by_approvers_finder_spec.rb
+15
-0
No files found.
ee/app/models/ee/merge_request.rb
View file @
ee6eb923
...
...
@@ -36,7 +36,7 @@ module EE
class_methods
do
def
select_from_union
(
relations
)
from_union
(
relations
,
remove_duplicates:
true
)
where
(
id:
from_union
(
relations
)
)
end
end
...
...
ee/changelogs/unreleased/id-500-filter-by-approver-and-priority.yml
0 → 100644
View file @
ee6eb923
---
title
:
Fix sorting by priority with filtering by approvers
merge_request
:
10446
author
:
type
:
fixed
ee/spec/finders/merge_requests/by_approvers_finder_spec.rb
View file @
ee6eb923
...
...
@@ -133,4 +133,19 @@ describe MergeRequests::ByApproversFinder do
)
end
end
context
'filter by approvers'
do
let
(
:mrs_by_ids
)
{
merge_requests
(
ids:
[
first_user
.
id
])
}
let
(
:mrs_by_usernames
)
{
merge_requests
(
names:
[
first_user
.
username
])
}
it
'can be ordered by popularity'
do
expect
(
mrs_by_ids
.
sort_by_attribute
(
"popularity"
)).
to
eq
([
merge_request_with_two_approvers
,
merge_request_with_approver
])
expect
(
mrs_by_usernames
.
sort_by_attribute
(
"popularity"
)).
to
eq
([
merge_request_with_two_approvers
,
merge_request_with_approver
])
end
it
'can be ordered by priority'
do
expect
(
mrs_by_usernames
.
sort_by_attribute
(
"priority"
)).
to
eq
([
merge_request_with_two_approvers
,
merge_request_with_approver
])
expect
(
mrs_by_ids
.
sort_by_attribute
(
"priority"
)).
to
eq
([
merge_request_with_two_approvers
,
merge_request_with_approver
])
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