From 2c8f84d3a6b199b04394ed1a5bba3bc0d8f1e811 Mon Sep 17 00:00:00 2001 From: Arturo Pie Date: Sun, 25 Mar 2012 23:38:10 -0400 Subject: Do not add record to identity map if the record doesn't have values for all the columns, so we don't get 'MissingAttributeError' later when trying to access other fields of the same record. --- activerecord/lib/active_record/identity_map.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/identity_map.rb b/activerecord/lib/active_record/identity_map.rb index 680d9ffea0..7ff755110f 100644 --- a/activerecord/lib/active_record/identity_map.rb +++ b/activerecord/lib/active_record/identity_map.rb @@ -90,7 +90,7 @@ module ActiveRecord end def add(record) - repository[record.class.symbolized_sti_name][record.id] = record + repository[record.class.symbolized_sti_name][record.id] = record if record.class.column_names - record.attribute_names == [] end def remove(record) -- cgit v1.2.3