diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-11 17:05:54 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-11 17:05:54 +0200 |
commit | 85cc1fa657f441417f36998a32a6a158c2697aad (patch) | |
tree | 457d830160931a39a07509a65346b248e97bc5e0 /activerecord/lib/active_record/associations | |
parent | b4976ce91ba003942acd3f285c6b4fb308657a69 (diff) | |
download | rails-85cc1fa657f441417f36998a32a6a158c2697aad.tar.gz rails-85cc1fa657f441417f36998a32a6a158c2697aad.tar.bz2 rails-85cc1fa657f441417f36998a32a6a158c2697aad.zip |
Revert "Don't overwrite unsaved updates when loading an association but preserve the order of the loaded records. [#4642 state:open]"
This commit introduced a regression described in ticket [#4830].
This reverts commit 0265c708b9696c3943518ad5f3dabdc22c5eba11.
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 5b68ca2edb..d9903243ce 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -388,7 +388,7 @@ module ActiveRecord begin if !loaded? if @target.is_a?(Array) && @target.any? - @target = find_target.map { |f| i = @target.index(f); i ? @target.delete_at(i) : f } + @target + @target = find_target + @target.find_all {|t| t.new_record? } else @target = find_target end |