Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2014-08-13 16:12:05 +0400
committerRobert Schilling <rschilling@student.tugraz.at>2014-08-13 17:48:26 +0400
commitb9519c83142d566ee562da57563db42849e91771 (patch)
tree4ba96aa8b92bf8b4c458e8c4ddb49ef16bc7313d /app
parentc9eaa46c738ad23bbb3d6f3dfbdaf8a485d0a030 (diff)
Validate label titel in project scope
Diffstat (limited to 'app')
-rw-r--r--app/models/label.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/label.rb b/app/models/label.rb
index 941520b4c74..515ed447f00 100644
--- a/app/models/label.rb
+++ b/app/models/label.rb
@@ -12,7 +12,7 @@ class Label < ActiveRecord::Base
validates :title,
presence: true,
format: { with: /\A[^&\?,&]*\z/ },
- uniqueness: true
+ uniqueness: { scope: :project_id }
scope :order_by_name, -> { reorder("labels.title ASC") }