Sha256: 476ceb668a3fe1a69d370e7378a9edbb3a407dbc4cec5466f3d6336be20f6a4c

Contents?: true

Size: 663 Bytes

Versions: 61

Compression:

Stored size: 663 Bytes

Contents

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

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

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

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
spree_api-4.1.9 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.8 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.7 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.6 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.5 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.4 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.3 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.2 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.1 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.0 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.0.rc3 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.0.rc2 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.0.rc1 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.0.3 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.0.2 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.0.1 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.0.0 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.0.0.rc3 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.0.0.rc2 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.0.0.rc1 app/controllers/spree/api/v1/countries_controller.rb