Sha256: 213022c50eb3c2a677460425d34fa09cfe016cadbaeb4e184aaf997ffaa58a0b

Contents?: true

Size: 609 Bytes

Versions: 31

Compression:

Stored size: 609 Bytes

Contents

module Spree
  module Api
    class CreditCardsController < Spree::Api::BaseController
      before_action :user

      def index
        @credit_cards = user
          .credit_cards
          .accessible_by(current_ability, :read)
          .with_payment_profile
          .ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
        respond_with(@credit_cards)
      end

      private

        def user
          if params[:user_id].present?
            @user ||= Spree::user_class.accessible_by(current_ability, :read).find(params[:user_id])
          end
        end

    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
spree_api-3.0.10 app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.9 app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.8 app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.7 app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.6.1 app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.6 app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.5 app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.4 app/controllers/spree/api/credit_cards_controller.rb
spree_api-2.4.10 app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.3 app/controllers/spree/api/credit_cards_controller.rb
spree_api-2.4.9 app/controllers/spree/api/credit_cards_controller.rb
solidus_api-1.0.0.pre2 app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.2 app/controllers/spree/api/credit_cards_controller.rb
spree_api-2.4.8 app/controllers/spree/api/credit_cards_controller.rb
solidus_api-1.0.0.pre app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.1 app/controllers/spree/api/credit_cards_controller.rb
spree_api-2.4.7 app/controllers/spree/api/credit_cards_controller.rb
spree_api-3.0.0 app/controllers/spree/api/credit_cards_controller.rb
spree_api-2.4.6 app/controllers/spree/api/credit_cards_controller.rb
spree_api-2.4.5 app/controllers/spree/api/credit_cards_controller.rb