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
iv
gitlab-ce
Commits
643c6186
Commit
643c6186
authored
Feb 09, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zj/gitlab-ce-unique-milestone-title-per-project'
parents
e0f923a1
308c967d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
CHANGELOG
CHANGELOG
+1
-0
app/models/milestone.rb
app/models/milestone.rb
+1
-1
spec/models/milestone_spec.rb
spec/models/milestone_spec.rb
+14
-0
No files found.
CHANGELOG
View file @
643c6186
...
@@ -41,6 +41,7 @@ v 8.5.0 (unreleased)
...
@@ -41,6 +41,7 @@ v 8.5.0 (unreleased)
- In seach autocomplete show only groups and projects you are member of
- In seach autocomplete show only groups and projects you are member of
- Fix: init.d script not working on OS X
- Fix: init.d script not working on OS X
- Faster snippet search
- Faster snippet search
- Title for milestones should be unique (Zeger-Jan van de Weg)
v 8.4.4
v 8.4.4
- Update omniauth-saml gem to 1.4.2
- Update omniauth-saml gem to 1.4.2
...
...
app/models/milestone.rb
View file @
643c6186
...
@@ -34,7 +34,7 @@ class Milestone < ActiveRecord::Base
...
@@ -34,7 +34,7 @@ class Milestone < ActiveRecord::Base
scope
:closed
,
->
{
with_state
(
:closed
)
}
scope
:closed
,
->
{
with_state
(
:closed
)
}
scope
:of_projects
,
->
(
ids
)
{
where
(
project_id:
ids
)
}
scope
:of_projects
,
->
(
ids
)
{
where
(
project_id:
ids
)
}
validates
:title
,
presence:
true
validates
:title
,
presence:
true
,
uniqueness:
{
scope: :project_id
}
validates
:project
,
presence:
true
validates
:project
,
presence:
true
strip_attributes
:title
strip_attributes
:title
...
...
spec/models/milestone_spec.rb
View file @
643c6186
...
@@ -33,6 +33,20 @@ describe Milestone, models: true do
...
@@ -33,6 +33,20 @@ describe Milestone, models: true do
let
(
:milestone
)
{
create
(
:milestone
)
}
let
(
:milestone
)
{
create
(
:milestone
)
}
let
(
:issue
)
{
create
(
:issue
)
}
let
(
:issue
)
{
create
(
:issue
)
}
describe
"unique milestone title per project"
do
it
"shouldn't accept the same title in a project twice"
do
new_milestone
=
Milestone
.
new
(
project:
milestone
.
project
,
title:
milestone
.
title
)
expect
(
new_milestone
).
not_to
be_valid
end
it
"should accept the same title in another project"
do
project
=
build
(
:project
)
new_milestone
=
Milestone
.
new
(
project:
project
,
title:
milestone
.
title
)
expect
(
new_milestone
).
to
be_valid
end
end
describe
"#percent_complete"
do
describe
"#percent_complete"
do
it
"should not count open issues"
do
it
"should not count open issues"
do
milestone
.
issues
<<
issue
milestone
.
issues
<<
issue
...
...
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