Sha256: 504c3e48c34dbd3e1f8aeffb0ffbd2b2bcec3794e35a5544b1636d8a60c4787a

Contents?: true

Size: 663 Bytes

Versions: 7

Compression:

Stored size: 663 Bytes

Contents

# frozen_string_literal: true

module Spree
  module Admin
    class InstallmentsController < ResourceController
      belongs_to 'subscription', model_class: SolidusSubscriptions::Subscription

      skip_before_action :load_resource, only: :index

      def index
        @search = collection.ransack((params[:q] || {}).reverse_merge(s: 'created_at desc'))

        @installments = @search.result(distinct: true).
                        page(params[:page]).
                        per(params[:per_page] || Spree::Config[:orders_per_page])
      end

      private

      def model_class
        ::SolidusSubscriptions::Installment
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solidus_subscriptions-2.0.2 app/controllers/spree/admin/installments_controller.rb
solidus_subscriptions-2.0.1 app/controllers/spree/admin/installments_controller.rb
solidus_subscriptions-2.0.0 app/controllers/spree/admin/installments_controller.rb
solidus_subscriptions-1.1.0 app/controllers/spree/admin/installments_controller.rb
solidus_subscriptions-1.0.1 app/controllers/spree/admin/installments_controller.rb
solidus_subscriptions-1.0.0 app/controllers/spree/admin/installments_controller.rb
solidus_subscriptions-1.0.0.rc1 app/controllers/spree/admin/installments_controller.rb