Sha256: 3acfc79b584ad933463e1bff28675948e26c0de0e58854bd99d9c0283bd7b547
Contents?: true
Size: 453 Bytes
Versions: 63
Compression:
Stored size: 453 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_attributes!(order_id: adjustable.id) else adjustment.update_attributes!(adjustable: adjustable.order) end end end end
Version data entries
63 entries across 63 versions & 1 rubygems