summaryrefslogtreecommitdiff
path: root/app/models/milestone.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <mail@zjvandeweg.nl>2016-02-02 10:44:30 +0100
committerZeger-Jan van de Weg <mail@zjvandeweg.nl>2016-02-08 12:45:32 +0100
commit308c967d0dee4b56613d4b285fbd0cf0a1c3ce69 (patch)
treec91a37f7c7903b278f2a66c60c83ace7d59ffeef /app/models/milestone.rb
parent05519b554a49057f6551595a3bc3f01e140f3c0b (diff)
downloadgitlab-ce-308c967d0dee4b56613d4b285fbd0cf0a1c3ce69.tar.gz
Validate uniqueness of milestone title per project
Fixes #3903
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r--app/models/milestone.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index c9a0ad8b9b6..9c4476c768e 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -34,7 +34,7 @@ class Milestone < ActiveRecord::Base
scope :closed, -> { with_state(:closed) }
scope :of_projects, ->(ids) { where(project_id: ids) }
- validates :title, presence: true
+ validates :title, presence: true, uniqueness: { scope: :project_id }
validates :project, presence: true
strip_attributes :title