Sha256: 1c34c2663a5f59915d1131f0e4614c7ea2a19d4fa64b1449ecc379a917bb6c5e
Contents?: true
Size: 358 Bytes
Versions: 9
Compression:
Stored size: 358 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
9 entries across 9 versions & 1 rubygems