Skip to content
Browse files

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...
1 parent 488ea89 commit a00a42dc013602c74fc6aca89fc9a69fe29c05b5 @arturopie arturopie committed Mar 25, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/identity_map.rb
2 activerecord/lib/active_record/identity_map.rb
@@ -90,7 +90,7 @@ def get(klass, primary_key)
def add(record)
- repository[record.class.symbolized_sti_name][] = record
+ repository[record.class.symbolized_sti_name][] = record if record.class.column_names - record.attribute_names == []
def remove(record)

0 comments on commit a00a42d

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