diff options
author | charlieablett <cablett@gitlab.com> | 2019-06-27 10:32:51 +1200 |
---|---|---|
committer | charlieablett <cablett@gitlab.com> | 2019-06-27 10:32:51 +1200 |
commit | 04d2d8f9b7e8593cb0ea3d8db7b57b843387fa2b (patch) | |
tree | 3b5755c7536b1974616394492064d523da40e7b4 /app/models/list.rb | |
parent | 82b87ae509e744dab135573da1f9b8ada4f81ed9 (diff) | |
download | gitlab-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.rb | 1 |
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 |