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.0.9 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.15 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.2.7 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.3.3 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.4.1 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.2.6 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.3.2 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.4.0 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.4.0.rc2 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.3.1 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.4.0.rc1 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.3.0 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.3.0.rc3 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.3.0.rc2 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.3.0.rc1 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.2.5 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.1.14 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.0.8 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.2.4 app/controllers/spree/api/v1/countries_controller.rb
spree_api-4.2.3.1 app/controllers/spree/api/v1/countries_controller.rb