Sha256: 3e9ccf11c93f27586a82377bfc90de7c7bc7057b0a6e721145810d2bc970b55d
Contents?: true
Size: 431 Bytes
Versions: 57
Compression:
Stored size: 431 Bytes
Contents
class FixAdjustmentOrderPresence < ActiveRecord::Migration[4.2] def change say 'Fixing adjustments without direct order reference' Spree::Adjustment.where(order: nil).find_each do |adjustment| adjustable = adjustment.adjustable if adjustable.is_a? Spree::Order adjustment.update!(order_id: adjustable.id) else adjustment.update!(adjustable: adjustable.order) end end end end
Version data entries
57 entries across 57 versions & 1 rubygems