summaryrefslogtreecommitdiff
path: root/app/models/label.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/label.rb')
-rw-r--r--app/models/label.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/label.rb b/app/models/label.rb
index 96c1515b41a..9ef57a05b3e 100644
--- a/app/models/label.rb
+++ b/app/models/label.rb
@@ -5,6 +5,9 @@ class Label < ActiveRecord::Base
include Referable
include Subscribable
include Gitlab::SQL::Pattern
+ include OptionallySearch
+ include Sortable
+ include FromUnion
# Represents a "No Label" state used for filtering Issues and Merge
# Requests that have no label assigned.
@@ -40,6 +43,8 @@ class Label < ActiveRecord::Base
scope :with_lists_and_board, -> { joins(lists: :board).merge(List.movable) }
scope :on_group_boards, ->(group_id) { with_lists_and_board.where(boards: { group_id: group_id }) }
scope :on_project_boards, ->(project_id) { with_lists_and_board.where(boards: { project_id: project_id }) }
+ scope :order_name_asc, -> { reorder(title: :asc) }
+ scope :order_name_desc, -> { reorder(title: :desc) }
def self.prioritized(project)
joins(:priorities)