From 0db98e9d864a86b793d58ba1274b86c6e4474f02 Mon Sep 17 00:00:00 2001 From: Ted Johansson Date: Mon, 24 Jul 2023 09:37:18 +0800 Subject: [PATCH] DEV: Remove deprecated ascending param from AdminUserIndexQuery (#22741) The parameter ascending was deprecated (replaced by asc) and marked for deletion in 2.9. This PR removes it. Since the resulting code was a simple one-liner, the method body was inlined instead. --- lib/admin_user_index_query.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/admin_user_index_query.rb b/lib/admin_user_index_query.rb index fd9c364b3b3..d8569ed0342 100644 --- a/lib/admin_user_index_query.rb +++ b/lib/admin_user_index_query.rb @@ -33,22 +33,11 @@ class AdminUserIndexQuery find_users_query.count end - def custom_direction - if params[:ascending] - Discourse.deprecate( - ":ascending is deprecated please use :asc instead", - output_in_test: true, - drop_from: "2.9.0", - ) - end - asc = params[:asc] || params[:ascending] - asc.present? && asc ? "ASC" : "DESC" - end - def initialize_query_with_order(klass) order = [] custom_order = params[:order] + custom_direction = params[:asc].present? ? "ASC" : "DESC" if custom_order.present? && without_dir = SORTABLE_MAPPING[custom_order.downcase.sub(/ (asc|desc)\z/, "")] order << "#{without_dir} #{custom_direction}"