Sha256: d7c8e3859173abb9039780778886f6b83bba709f46ee13bfac71ae52a0fa144d

Contents?: true

Size: 457 Bytes

Versions: 47

Compression:

Stored size: 457 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
    end
  end
end

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
solidus_backend-2.10.5 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.10.3 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.10.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.9.6 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.8.6 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.10.1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.9.5 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.10.0 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.9.4 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.6.6 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.7.4 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.8.5 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.9.3 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.9.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.10.0.beta1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.7.3 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.6.5 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.9.1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.9.0 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.9.0.rc.1 app/controllers/spree/admin/stock_locations_controller.rb