1
0
mirror of synced 2026-08-04 14:16:55 +00:00

rm request to empty model

This commit is contained in:
Rimian Perkins
2019-11-07 15:49:10 +11:00
parent 1da6986d8f
commit 0b90caac2d
+1 -21
View File
@@ -3,27 +3,7 @@
module DiscoursePatrons
class AdminController < ::Admin::AdminController
def index
payments = Payment.all.order(payments_order)
render_serialized(payments, PaymentSerializer)
end
private
def payments_order
if %w(created_at amount).include?(params[:order])
{ params[:order] => ascending }
else
{ created_at: :desc }
end
end
def ascending
if params[:descending] == 'false'
:desc
else
:asc
end
head 200
end
end
end