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