Sha256: 04a91848df3abd667241fe6a3d081490a86695d3df9ad3059fa47a53993eb65d
Contents?: true
Size: 454 Bytes
Versions: 21
Compression:
Stored size: 454 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!(order_id: adjustable.order.id) end end end end
Version data entries
21 entries across 21 versions & 1 rubygems