diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-17 18:08:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-17 18:08:37 +0300 |
commit | 37eff29d5ce44899e34c7c2ac319b314f2f26d15 (patch) | |
tree | b74e1632fdb58ea10972f270bfec70a4e6ee07b0 /app/models/board.rb | |
parent | 9411a664118a3247d0a56baf7e7ef4549c1201c3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/board.rb')
-rw-r--r-- | app/models/board.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/board.rb b/app/models/board.rb index f3f938224a4..38bbb550044 100644 --- a/app/models/board.rb +++ b/app/models/board.rb @@ -11,6 +11,8 @@ class Board < ApplicationRecord validates :group, presence: true, unless: :project scope :with_associations, -> { preload(:destroyable_lists) } + scope :order_by_name_asc, -> { order(arel_table[:name].lower.asc) } + scope :first_board, -> { where(id: self.order_by_name_asc.limit(1).select(:id)) } def project_needed? !group |