Sha256: 3496da13539e50415184cf9a2e884953a99c073a9e1cf75cd8c47e3d31c6b5c6

Contents?: true

Size: 712 Bytes

Versions: 16

Compression:

Stored size: 712 Bytes

Contents

module Spree
  module Api
    class CountriesController < Spree::Api::BaseController
      skip_before_action :check_for_user_or_api_key
      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

16 entries across 16 versions & 2 rubygems

Version Path
solidus_api-1.0.0.pre2 app/controllers/spree/api/countries_controller.rb
solidus_api-1.0.0.pre app/controllers/spree/api/countries_controller.rb
spree_api-3.0.0 app/controllers/spree/api/countries_controller.rb
spree_api-2.4.6 app/controllers/spree/api/countries_controller.rb
spree_api-2.4.5 app/controllers/spree/api/countries_controller.rb
spree_api-3.0.0.rc4 app/controllers/spree/api/countries_controller.rb
spree_api-3.0.0.rc3 app/controllers/spree/api/countries_controller.rb
spree_api-2.4.4 app/controllers/spree/api/countries_controller.rb
spree_api-3.0.0.rc1 app/controllers/spree/api/countries_controller.rb
spree_api-2.4.3 app/controllers/spree/api/countries_controller.rb
spree_api-2.4.2 app/controllers/spree/api/countries_controller.rb
spree_api-2.4.1 app/controllers/spree/api/countries_controller.rb
spree_api-2.4.0 app/controllers/spree/api/countries_controller.rb
spree_api-2.4.0.rc3 app/controllers/spree/api/countries_controller.rb
spree_api-2.4.0.rc2 app/controllers/spree/api/countries_controller.rb
spree_api-2.4.0.rc1 app/controllers/spree/api/countries_controller.rb