diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /app/models/milestone.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r-- | app/models/milestone.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 86da29dd27a..ff4fadb0f13 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -31,7 +31,7 @@ class Milestone < ApplicationRecord end scope :order_by_name_asc, -> { order(Arel::Nodes::Ascending.new(arel_table[:title].lower)) } - scope :reorder_by_due_date_asc, -> { reorder(Gitlab::Database.nulls_last_order('due_date', 'ASC')) } + scope :reorder_by_due_date_asc, -> { reorder(arel_table[:due_date].asc.nulls_last) } scope :with_api_entity_associations, -> { preload(project: [:project_feature, :route, namespace: :route]) } scope :order_by_dates_and_title, -> { order(due_date: :asc, start_date: :asc, title: :asc) } @@ -116,15 +116,15 @@ class Milestone < ApplicationRecord when 'due_date_asc' reorder_by_due_date_asc when 'due_date_desc' - reorder(Gitlab::Database.nulls_last_order('due_date', 'DESC')) + reorder(arel_table[:due_date].desc.nulls_last) when 'name_asc' reorder(Arel::Nodes::Ascending.new(arel_table[:title].lower)) when 'name_desc' reorder(Arel::Nodes::Descending.new(arel_table[:title].lower)) when 'start_date_asc' - reorder(Gitlab::Database.nulls_last_order('start_date', 'ASC')) + reorder(arel_table[:start_date].asc.nulls_last) when 'start_date_desc' - reorder(Gitlab::Database.nulls_last_order('start_date', 'DESC')) + reorder(arel_table[:start_date].desc.nulls_last) else order_by(method) end |