aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index 17795f1b7d..c32dd77420 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -402,6 +402,9 @@ module ActiveRecord
return memory if persisted.empty?
persisted.map! do |record|
+
+ # To work with ruby 1.8.7
+ # > 1.9 #=> mem_record = memory.delete(record)
mem_record_index = memory.index(record)
if mem_record_index
mem_record = memory.at(mem_record_index)