discourse-subscriptions/app/controllers/admin_controller.rb

22 lines
415 B
Ruby
Raw Normal View History

2019-09-13 22:56:28 -04:00
# frozen_string_literal: true
module DiscoursePatrons
class AdminController < ::Admin::AdminController
def index
2019-09-15 07:00:39 -04:00
payments = Payment.all.order(payments_order)
2019-09-13 22:56:28 -04:00
render_serialized(payments, PaymentSerializer)
end
2019-09-15 07:00:39 -04:00
private
def payments_order
if %w(created_at amount).include?(params[:order])
params[:order].to_sym
else
:created_at
end
end
2019-09-13 22:56:28 -04:00
end
end