diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-12-02 02:53:44 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-12-08 00:57:26 +0300 |
commit | e48391b813d3e5079238aa3f0662e7a46e1b4a54 (patch) | |
tree | bc7abec1eb4b27a16dcf47d09483b967bffdd3a8 /app/models/label.rb | |
parent | b3200c8c44f2351d88d5d78d7ded3ac06001bd7c (diff) |
Add custom ColorValidator
Diffstat (limited to 'app/models/label.rb')
-rw-r--r-- | app/models/label.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index bef6063fe88..220da10a6ab 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -27,9 +27,7 @@ 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: false + validates :color, color: true, allow_blank: false validates :project, presence: true, unless: Proc.new { |service| service.template? } # Don't allow '?', '&', and ',' for label titles |