From d1979a70a1a0ca7d691fe55fce1e01dc645a79b2 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Mon, 16 Sep 2013 14:26:43 +1000 Subject: [PATCH] Fix migration - dependency on modified model relations --- .../20130912021553_create_distributors_payment_methods.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/db/migrate/20130912021553_create_distributors_payment_methods.rb b/db/migrate/20130912021553_create_distributors_payment_methods.rb index 8e36a6fe41..a9e2ed1738 100644 --- a/db/migrate/20130912021553_create_distributors_payment_methods.rb +++ b/db/migrate/20130912021553_create_distributors_payment_methods.rb @@ -1,4 +1,9 @@ class CreateDistributorsPaymentMethods < ActiveRecord::Migration + class Spree::PaymentMethod < ActiveRecord::Base + belongs_to :distributor, class_name: 'Enterprise' + has_and_belongs_to_many :distributors, join_table: 'distributors_payment_methods', :class_name => 'Enterprise', association_foreign_key: 'distributor_id' + end + def up create_table :distributors_payment_methods, :id => false do |t| t.references :distributor