Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-14 22:12:07 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 19:58:27 +0300
commit297892011330ecdd2fa7cbe47fbc6fd4f3b62171 (patch)
tree6cbbb21eae4f3fa3d28b33599a0ea87fbf0f34ec /app/models/label.rb
parentde9d3915d249a59e65226f6dd2ebe1f50a47306e (diff)
Add LabelPriority model
Diffstat (limited to 'app/models/label.rb')
-rw-r--r--app/models/label.rb7
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