summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPatrick Derichs <pderichs@gitlab.com>2019-07-24 08:53:29 +0200
committerPatrick Derichs <pderichs@gitlab.com>2019-07-24 10:22:37 +0200
commit13e7feef08a4b4fd32d553ac58f943a1f8a3d579 (patch)
treed50026cd1a2c8dc8eaf3af8599b3ef42bdf7e981 /app
parent245fdf5610187f172b859edb3da717066bc25867 (diff)
downloadgitlab-ce-13e7feef08a4b4fd32d553ac58f943a1f8a3d579.tar.gz
Add where condition to filter out invalid labels with nil type63730-fix-500-status-labels-pd
Diffstat (limited to 'app')
-rw-r--r--app/models/label.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/label.rb b/app/models/label.rb
index b83e0862bab..dd403562bfa 100644
--- a/app/models/label.rb
+++ b/app/models/label.rb
@@ -33,7 +33,7 @@ class Label < ApplicationRecord
default_scope { order(title: :asc) }
- scope :templates, -> { where(template: true) }
+ scope :templates, -> { where(template: true, type: [Label.name, nil]) }
scope :with_title, ->(title) { where(title: title) }
scope :with_lists_and_board, -> { joins(lists: :board).merge(List.movable) }
scope :on_project_boards, ->(project_id) { with_lists_and_board.where(boards: { project_id: project_id }) }