Sha256: f428645f8882c725381cfef4a3d4406cbc8a11a3d90828d293001b34c391c7c3

Contents?: true

Size: 660 Bytes

Versions: 43

Compression:

Stored size: 660 Bytes

Contents

module Spree
  module Api
    class CountriesController < Spree::Api::BaseController
      skip_before_action :authenticate_user

      def index
        @countries = Country.accessible_by(current_ability, :read).ransack(params[:q]).result.
                     includes(:states).order('name ASC').
                     page(params[:page]).per(params[:per_page])
        country = Country.order("updated_at ASC").last
        if stale?(country)
          respond_with(@countries)
        end
      end

      def show
        @country = Country.accessible_by(current_ability, :read).find(params[:id])
        respond_with(@country)
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
solidus_api-2.0.3 app/controllers/spree/api/countries_controller.rb
solidus_api-1.4.2 app/controllers/spree/api/countries_controller.rb
solidus_api-1.3.2 app/controllers/spree/api/countries_controller.rb
solidus_api-1.2.3 app/controllers/spree/api/countries_controller.rb
solidus_api-1.1.4 app/controllers/spree/api/countries_controller.rb
solidus_api-1.0.7 app/controllers/spree/api/countries_controller.rb
solidus_api-2.0.2 app/controllers/spree/api/countries_controller.rb
solidus_api-1.4.1 app/controllers/spree/api/countries_controller.rb
solidus_api-2.0.1 app/controllers/spree/api/countries_controller.rb
solidus_api-2.0.0 app/controllers/spree/api/countries_controller.rb
solidus_api-1.4.0 app/controllers/spree/api/countries_controller.rb
solidus_api-2.0.0.rc1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.4.0.rc1 app/controllers/spree/api/countries_controller.rb
solidus_api-2.0.0.beta1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.4.0.beta1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.3.1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.3.0 app/controllers/spree/api/countries_controller.rb
solidus_api-1.3.0.rc2 app/controllers/spree/api/countries_controller.rb
solidus_api-1.3.0.rc1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.3.0.beta1 app/controllers/spree/api/countries_controller.rb