Sha256: 0bc21c7267d0ad3b84048bb97f2d5d5eb51838debdd317eab04ad3587844f329
Contents?: true
Size: 515 Bytes
Versions: 9
Compression:
Stored size: 515 Bytes
Contents
# This migration comes from spree (originally 20141101231208) 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_attributes!(order_id: adjustable.id) else adjustment.update_attributes!(adjustable: adjustable.order) end end end end
Version data entries
9 entries across 9 versions & 2 rubygems