diff options
Diffstat (limited to 'app/models/label.rb')
-rw-r--r-- | app/models/label.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index e5ad11983be..59e7afe53f3 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -19,6 +19,7 @@ class Label < ActiveRecord::Base validates :color, color: true, allow_blank: false validates :project, presence: true, unless: Proc.new { |service| service.template? } + validates :priority, presence: false, default: false # Don't allow '?', '&', and ',' for label titles validates :title, @@ -29,6 +30,7 @@ class Label < ActiveRecord::Base default_scope { order(title: :asc) } scope :templates, -> { where(template: true) } + scope :prioritized, ->(value = true) { where(priority: value) } alias_attribute :name, :title |