[Tickets] Allow ordering tickets by id (#761)

Resolves #754
This commit is contained in:
Donovan Daniels 2024-09-29 15:11:24 -05:00 committed by GitHub
parent 9c82b003a3
commit 7650e1606a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -265,7 +265,11 @@ class Ticket < ApplicationRecord
end
end
q.order(Arel.sql("CASE status WHEN 'pending' THEN 0 WHEN 'partial' THEN 1 ELSE 2 END ASC, id DESC"))
if params[:order].present?
q.apply_basic_order(params)
else
q.order(Arel.sql("CASE status WHEN 'pending' THEN 0 WHEN 'partial' THEN 1 ELSE 2 END ASC, id DESC"))
end
end
end