Sha256: de8c45975d454632ae9bd945bef132cee056ccb7ed3df6797273c67eac9aa53e

Contents?: true

Size: 414 Bytes

Versions: 67

Compression:

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

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
spree_backend-3.4.6 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.2.9 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.1.14 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.3.6 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.2.8 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.1.13 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.4.5 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.3.5 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.4.4 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.4.3 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.3.4 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.2.7 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.1.12 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.4.2 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.3.3 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.2.6 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.1.11 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.4.1 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.4.0 app/controllers/spree/admin/stock_locations_controller.rb
spree_backend-3.4.0.rc2 app/controllers/spree/admin/stock_locations_controller.rb