Labels need to be valid on name
This commit is contained in:
parent
a3c969cd92
commit
c9eaa46c73
|
@ -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") }
|
||||
|
||||
|
|
Loading…
Reference in New Issue