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-1.0.6 app/controllers/spree/api/countries_controller.rb
solidus_api-1.2.2 app/controllers/spree/api/countries_controller.rb
solidus_api-1.2.1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.1.3 app/controllers/spree/api/countries_controller.rb
solidus_api-1.0.5 app/controllers/spree/api/countries_controller.rb
solidus_api-1.2.0 app/controllers/spree/api/countries_controller.rb
solidus_api-1.2.0.rc2 app/controllers/spree/api/countries_controller.rb
solidus_api-1.0.4 app/controllers/spree/api/countries_controller.rb
solidus_api-1.1.2 app/controllers/spree/api/countries_controller.rb
solidus_api-1.2.0.rc1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.2.0.beta1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.0.3 app/controllers/spree/api/countries_controller.rb
solidus_api-1.1.1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.1.0 app/controllers/spree/api/countries_controller.rb
solidus_api-1.1.0.pre2 app/controllers/spree/api/countries_controller.rb
solidus_api-1.1.0.pre1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.1.0.beta1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.0.2 app/controllers/spree/api/countries_controller.rb
solidus_api-1.0.1 app/controllers/spree/api/countries_controller.rb
solidus_api-1.0.0 app/controllers/spree/api/countries_controller.rb