Sha256: 92d7acb556bb035eb87472c05038b6117dffd24839ff5722c258f467e702a518

Contents?: true

Size: 426 Bytes

Versions: 37

Compression:

Stored size: 426 Bytes

Contents

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] = Spree.t(:stock_locations_need_a_default_country)
        redirect_to(admin_stock_locations_path) && return
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
solidus_backend-2.4.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.4.1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.3.1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.2.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.1.1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.0.3 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-1.4.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-1.3.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.4.0 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.4.0.rc1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.4.0.beta1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.3.0 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.3.0.rc3 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.3.0.rc2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.3.0.rc1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.3.0.beta1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.0.2 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-1.4.1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.2.1 app/controllers/spree/admin/stock_locations_controller.rb
solidus_backend-2.2.0 app/controllers/spree/admin/stock_locations_controller.rb