Sha256: 767288fe331c9b4a79b20dc94b2272712b1456d5059b653f5910bbf9bfa0b98d
Contents?: true
Size: 359 Bytes
Versions: 133
Compression:
Stored size: 359 Bytes
Contents
class SetDefaultStockLocationOnShipments < ActiveRecord::Migration def change if Spree::Shipment.where('stock_location_id IS NULL').count > 0 location = Spree::StockLocation.find_by(name: 'default') || Spree::StockLocation.first Spree::Shipment.where('stock_location_id IS NULL').update_all(stock_location_id: location.id) end end end
Version data entries
133 entries across 133 versions & 3 rubygems