diff options
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/label.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index ce982579675..e2379bb6d77 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -3,10 +3,12 @@ class Label < ActiveRecord::Base has_many :label_links, dependent: :destroy has_many :issues, through: :label_links, source: :target, source_type: 'Issue' - validates :color, format: { with: /\A\#[0-9A-Fa-f]{6}+\Z/ }, allow_blank: true + validates :color, + format: { with: /\A\#[0-9A-Fa-f]{6}+\Z/ }, + allow_blank: false validates :project, presence: true - # Dont allow '?', '&', and ',' for label titles + # Don't allow '?', '&', and ',' for label titles validates :title, presence: true, format: { with: /\A[^&\?,&]*\z/ } scope :order_by_name, -> { reorder("labels.title ASC") } |
