summaryrefslogtreecommitdiff
path: root/app/models/list.rb
diff options
context:
space:
mode:
authorcharlieablett <cablett@gitlab.com>2019-06-27 10:32:51 +1200
committercharlieablett <cablett@gitlab.com>2019-06-27 10:32:51 +1200
commit04d2d8f9b7e8593cb0ea3d8db7b57b843387fa2b (patch)
tree3b5755c7536b1974616394492064d523da40e7b4 /app/models/list.rb
parent82b87ae509e744dab135573da1f9b8ada4f81ed9 (diff)
downloadgitlab-ce-04d2d8f9b7e8593cb0ea3d8db7b57b843387fa2b.tar.gz
Move order lambda to list scope63212-n-1-queries-in-projects-id-boards-api
- apply ordering to both list scopes in `Board`
Diffstat (limited to 'app/models/list.rb')
-rw-r--r--app/models/list.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/list.rb b/app/models/list.rb
index 17b1a8510cf..d28a9bda82d 100644
--- a/app/models/list.rb
+++ b/app/models/list.rb
@@ -16,6 +16,7 @@ class List < ApplicationRecord
scope :destroyable, -> { where(list_type: list_types.slice(*destroyable_types).values) }
scope :movable, -> { where(list_type: list_types.slice(*movable_types).values) }
scope :preload_associations, -> { preload(:board, :label) }
+ scope :ordered, -> { order(:list_type, :position) }
class << self
def destroyable_types