From 2a1b45af56d6c0ec39941c50ff98bf2e6d74d274 Mon Sep 17 00:00:00 2001 From: Will Bryant Date: Mon, 8 Sep 2014 23:32:42 +1200 Subject: fix fixtures not loading if a belongs_to association is defined with a :foreign_key option that's a symbol --- activerecord/lib/active_record/fixtures.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 1724fa893d..4044f5f7b2 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -661,7 +661,7 @@ module ActiveRecord row[association.foreign_type] = $1 end - fk_type = association.active_record.columns_hash[association.foreign_key].type + fk_type = association.active_record.columns_hash[fk_name].type row[fk_name] = ActiveRecord::FixtureSet.identify(value, fk_type) end when :has_many -- cgit v1.2.3