Sha256: 175cb0f82d31aea0e9e0b6a1ffc6b7d7442d29c352b1e6c4e1bc96cbd80fa84a

Contents?: true

Size: 568 Bytes

Versions: 85

Compression:

Stored size: 568 Bytes

Contents

# frozen_string_literal: true

module Spree
  module Admin
    class StockLocationsController < ResourceController
      before_action :set_country, only: :new

      private

      def set_country
        @stock_location.country = Spree::Country.default
      rescue ActiveRecord::RecordNotFound
        flash[:error] = t('spree.stock_locations_need_a_default_country')
        redirect_to(admin_stock_locations_path) && return
      end

      def collection
        super.page(params[:page]).per(Spree::Config[:admin_products_per_page])
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
solidus_backend-4.4.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.4.1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.4.0 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.3.4 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.2.4 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.1.5 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.3.3 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.3.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.1.4 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.3.1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.3.0 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.2.3 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.1.3 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.0.4 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-3.4.6 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.0.3 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.1.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.2.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-3.4.5 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-4.2.1 app/controllers/spree/admin/stock_locations_controller.rb