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.

This commit is contained in:
Arturo Pie
2012-03-25 23:38:10 -04:00
parent 488ea89a4b
commit a00a42dc01

View File

@@ -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)