mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-18 17:16:08 +10:00
Labels need to be valid on name
This commit is contained in:
+4
-1
@@ -9,7 +9,10 @@ class Label < ActiveRecord::Base
|
||||
validates :project, presence: true
|
||||
|
||||
# Don't allow '?', '&', and ',' for label titles
|
||||
validates :title, presence: true, format: { with: /\A[^&\?,&]*\z/ }
|
||||
validates :title,
|
||||
presence: true,
|
||||
format: { with: /\A[^&\?,&]*\z/ },
|
||||
uniqueness: true
|
||||
|
||||
scope :order_by_name, -> { reorder("labels.title ASC") }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user