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:
authorcharlieablett <cablett@gitlab.com>2019-06-27 01:32:51 +0300
committercharlieablett <cablett@gitlab.com>2019-06-27 01:32:51 +0300
commit04d2d8f9b7e8593cb0ea3d8db7b57b843387fa2b (patch)
tree3b5755c7536b1974616394492064d523da40e7b4 /app/models/board.rb
parent82b87ae509e744dab135573da1f9b8ada4f81ed9 (diff)
Move order lambda to list scope
- apply ordering to both list scopes in `Board`
Diffstat (limited to 'app/models/board.rb')
-rw-r--r--app/models/board.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/board.rb b/app/models/board.rb
index cde5ee7c5b5..50b6ca9b70f 100644
--- a/app/models/board.rb
+++ b/app/models/board.rb
@@ -4,8 +4,8 @@ class Board < ApplicationRecord
belongs_to :group
belongs_to :project
- has_many :lists, -> { order(:list_type, :position) }, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
- has_many :destroyable_lists, -> { lists.destroyable }, class_name: "List"
+ has_many :lists, -> { ordered }, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
+ has_many :destroyable_lists, -> { destroyable.ordered }, class_name: "List"
validates :project, presence: true, if: :project_needed?
validates :group, presence: true, unless: :project