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