Commit c9eaa46c authored by Robert Schilling's avatar Robert Schilling
Browse files

Labels need to be valid on name

parent b99ce78d1e2e
......@@ -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") }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment