From 2b2f41fd972133b8bfbbc94ebe3bec6b27a0689a Mon Sep 17 00:00:00 2001 From: Victor Costan Date: Thu, 4 Jun 2015 12:27:45 -0400 Subject: Fix crash when loading fixture with belongs_to association defined in abstract base class. --- 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 1ec8f818cd..eed1853841 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -669,7 +669,7 @@ module ActiveRecord row[association.foreign_type] = $1 end - fk_type = association.active_record.type_for_attribute(fk_name).type + fk_type = reflection_class.type_for_attribute(fk_name).type row[fk_name] = ActiveRecord::FixtureSet.identify(value, fk_type) end when :has_many -- cgit v1.2.3