Skip to content
This repository
Browse code

Do not add record to identity map if the record doesn't have values f…

…or all the columns, so we don't get 'MissingAttributeError' later when trying to access other fields of the same record.
  • Loading branch information...
commit a00a42dc013602c74fc6aca89fc9a69fe29c05b5 1 parent 488ea89
Arturo Pie authored March 25, 2012
2  activerecord/lib/active_record/identity_map.rb
@@ -90,7 +90,7 @@ def get(klass, primary_key)
90 90
       end
91 91
 
92 92
       def add(record)
93  
-        repository[record.class.symbolized_sti_name][record.id] = record
  93
+        repository[record.class.symbolized_sti_name][record.id] = record if record.class.column_names - record.attribute_names == []
94 94
       end
95 95
 
96 96
       def remove(record)

0 notes on commit a00a42d

Please sign in to comment.
Something went wrong with that request. Please try again.