diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-19 03:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-19 03:09:03 +0300 |
commit | cd49d91db362a479c1b53de07741713f7e7ea2cc (patch) | |
tree | 6d5f244f9d6e805a15ffc93172454788658af1d7 /app/models/issue.rb | |
parent | 705210af74e93f829f59e00f311cba07ea8bd5c7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 75727fff2cd..91d4b78f7c8 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -125,6 +125,8 @@ class Issue < ApplicationRecord scope :order_created_at_desc, -> { reorder(created_at: :desc) } scope :order_severity_asc, -> { includes(:issuable_severity).order('issuable_severities.severity ASC NULLS FIRST') } scope :order_severity_desc, -> { includes(:issuable_severity).order('issuable_severities.severity DESC NULLS LAST') } + scope :order_escalation_status_asc, -> { includes(:incident_management_issuable_escalation_status).order(::Gitlab::Database.nulls_last_order('incident_management_issuable_escalation_status.status')) } + scope :order_escalation_status_desc, -> { includes(:incident_management_issuable_escalation_status).order(::Gitlab::Database.nulls_last_order('incident_management_issuable_escalation_status.status', 'DESC')) } scope :preload_associated_models, -> { preload(:assignees, :labels, project: :namespace) } scope :with_web_entity_associations, -> { preload(:author, project: [:project_feature, :route, namespace: :route]) } @@ -327,6 +329,8 @@ class Issue < ApplicationRecord when 'relative_position', 'relative_position_asc' then order_by_relative_position when 'severity_asc' then order_severity_asc.with_order_id_desc when 'severity_desc' then order_severity_desc.with_order_id_desc + when 'escalation_status_asc' then order_escalation_status_asc.with_order_id_desc + when 'escalation_status_desc' then order_escalation_status_desc.with_order_id_desc else super end |