Permalink
Browse files

Fix nested attribute for memory record.

  • Loading branch information...
1 parent 7278547 commit cfb5f1b6083d4b0dabaaab70c383d223193811fd @arunagw arunagw committed May 31, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/lib/active_record/associations/collection_association.rb
@@ -402,7 +402,11 @@ def merge_target_lists(persisted, memory)
return memory if persisted.empty?
persisted.map! do |record|
- mem_record = memory.delete(record)
+ mem_record_index = memory.index(record)
+ if mem_record_index
+ mem_record = memory.at(mem_record_index)
+ memory.delete_at(mem_record_index)
+ end
if mem_record
(record.attribute_names - mem_record.changes.keys).each do |name|

0 comments on commit cfb5f1b

Please sign in to comment.