diff options
Diffstat (limited to 'app/models/label.rb')
-rw-r--r-- | app/models/label.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index 8b775e81db7..3ce4e253035 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -16,6 +16,7 @@ class Label < ActiveRecord::Base default_value_for :color, DEFAULT_COLOR has_many :lists, dependent: :destroy + has_many :priorities, class_name: 'LabelPriority' has_many :label_links, dependent: :destroy has_many :issues, through: :label_links, source: :target, source_type: 'Issue' has_many :merge_requests, through: :label_links, source: :target, source_type: 'MergeRequest' @@ -26,8 +27,6 @@ class Label < ActiveRecord::Base validates :title, presence: true, format: { with: /\A[^,]+\z/ } validates :title, uniqueness: { scope: [:group_id, :project_id] } - before_save :nullify_priority - default_scope { order(title: :asc) } scope :templates, -> { where(template: true) } @@ -149,10 +148,6 @@ class Label < ActiveRecord::Base end end - def nullify_priority - self.priority = nil if priority.blank? - end - def sanitize_title(value) CGI.unescapeHTML(Sanitize.clean(value.to_s)) end |