rm request to empty model
This commit is contained in:
parent
1da6986d8f
commit
0b90caac2d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue