Commit c9eaa46c authored by Robert Schilling's avatar Robert Schilling

Labels need to be valid on name

parent a3c969cd
...@@ -9,7 +9,10 @@ class Label < ActiveRecord::Base ...@@ -9,7 +9,10 @@ class Label < ActiveRecord::Base
validates :project, presence: true validates :project, presence: true
# Don't allow '?', '&', and ',' for label titles # 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") } 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