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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-13 21:08:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-13 21:08:33 +0300
commit9adada1187b920547a57b4bb406c3e3c55436bf1 (patch)
tree6c246b5f6acd81f24071f654a41df5081d671df1 /lib/api/helpers.rb
parent7eca3f56625526ffa7f263c1fef0fcea34de8ca6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index f3d7650693d..a079c591519 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -394,7 +394,14 @@ module API
end
def order_options_with_tie_breaker
- order_options = { params[:order_by] => params[:sort] }
+ order_by = if Feature.enabled?(:replace_order_by_created_at_with_id) &&
+ params[:order_by] == 'created_at'
+ 'id'
+ else
+ params[:order_by]
+ end
+
+ order_options = { order_by => params[:sort] }
order_options['id'] ||= params[:sort] || 'asc'
order_options
end