mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 00:33:02 +08:00
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.
This commit is contained in:
parent
7a790a5f4c
commit
0db98e9d86
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue
Block a user