From 0f1142fc308cb80a50a41982d66ce5da5727e66f Mon Sep 17 00:00:00 2001 From: Andrew Spinks Date: Wed, 14 Aug 2013 10:32:47 +1000 Subject: [PATCH] Define class used in migration. --- ...ate_enterprise_fee_records_for_product_distributions.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/db/migrate/20130809045637_create_enterprise_fee_records_for_product_distributions.rb b/db/migrate/20130809045637_create_enterprise_fee_records_for_product_distributions.rb index 2cb18b82b7..b826f51fdb 100644 --- a/db/migrate/20130809045637_create_enterprise_fee_records_for_product_distributions.rb +++ b/db/migrate/20130809045637_create_enterprise_fee_records_for_product_distributions.rb @@ -1,4 +1,11 @@ class CreateEnterpriseFeeRecordsForProductDistributions < ActiveRecord::Migration + + class ProductDistribution < ActiveRecord::Base + belongs_to :shipping_method, :class_name => 'Spree::ShippingMethod' + belongs_to :distributor, :class_name => 'Enterprise' + belongs_to :enterprise_fee + end + def up ProductDistribution.all.each do |pd| calculator = pd.shipping_method.calculator.dup