From ef97e153405002e5102273d4063418b36a44683e Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Mon, 7 Oct 2013 09:22:33 +1100 Subject: [PATCH] Temporarily make originator association available in UpgradeAdjustment migration --- core/db/migrate/20130807024301_upgrade_adjustments.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/db/migrate/20130807024301_upgrade_adjustments.rb b/core/db/migrate/20130807024301_upgrade_adjustments.rb index 5125fb536b3..f502794cfa2 100644 --- a/core/db/migrate/20130807024301_upgrade_adjustments.rb +++ b/core/db/migrate/20130807024301_upgrade_adjustments.rb @@ -1,5 +1,9 @@ class UpgradeAdjustments < ActiveRecord::Migration def up + # Temporarily make originator association available + Spree::Adjustment.class_eval do + belongs_to :originator, polymorphic: true + end # Shipping adjustments are now tracked as fields on the object Spree::Adjustment.where(:source_type => "Spree::Shipment").find_each do |adjustment| # Account for possible invalid data