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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
c3bca2ac
Commit
c3bca2ac
authored
May 29, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Milestone - Participants list is showing duplicate assignees
parent
e5226177
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
app/models/milestone.rb
app/models/milestone.rb
+1
-1
spec/models/milestone_spec.rb
spec/models/milestone_spec.rb
+13
-0
No files found.
app/models/milestone.rb
View file @
c3bca2ac
...
@@ -107,7 +107,7 @@ class Milestone < ActiveRecord::Base
...
@@ -107,7 +107,7 @@ class Milestone < ActiveRecord::Base
end
end
def
participants
def
participants
User
.
joins
(
assigned_issues: :milestone
).
where
(
"milestones.id = ?"
,
id
)
User
.
joins
(
assigned_issues: :milestone
).
where
(
"milestones.id = ?"
,
id
)
.
uniq
end
end
def
self
.
sort
(
method
)
def
self
.
sort
(
method
)
...
...
spec/models/milestone_spec.rb
View file @
c3bca2ac
...
@@ -249,4 +249,17 @@ describe Milestone, models: true do
...
@@ -249,4 +249,17 @@ describe Milestone, models: true do
expect
(
milestone
.
to_reference
(
another_project
)).
to
eq
"sample-project%1"
expect
(
milestone
.
to_reference
(
another_project
)).
to
eq
"sample-project%1"
end
end
end
end
describe
'#participants'
do
let
(
:project
)
{
build
(
:empty_project
,
name:
'sample-project'
)
}
let
(
:milestone
)
{
build
(
:milestone
,
iid:
1
,
project:
project
)
}
it
'returns participants without duplicates'
do
user
=
create
:user
create
:issue
,
project:
project
,
milestone:
milestone
,
assignees:
[
user
]
create
:issue
,
project:
project
,
milestone:
milestone
,
assignees:
[
user
]
expect
(
milestone
.
participants
).
to
eq
[
user
]
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