diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-09-13 14:57:57 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-11-19 19:07:03 -0300 |
commit | dd6e6808153cd033ac5dd3c431f579f640125293 (patch) | |
tree | ecaf5fcf2355b2148c0afa5ed6ba65646891d6c0 /activerecord/lib/active_record/association_preload.rb | |
parent | 7df61754a5e66ed01020800bcc9903d934dbbb7b (diff) | |
download | rails-dd6e6808153cd033ac5dd3c431f579f640125293.tar.gz rails-dd6e6808153cd033ac5dd3c431f579f640125293.tar.bz2 rails-dd6e6808153cd033ac5dd3c431f579f640125293.zip |
Prevent pushing duplicated records when using identity map.
Diffstat (limited to 'activerecord/lib/active_record/association_preload.rb')
-rw-r--r-- | activerecord/lib/active_record/association_preload.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb index 9743b1b4a7..065ecf5bf0 100644 --- a/activerecord/lib/active_record/association_preload.rb +++ b/activerecord/lib/active_record/association_preload.rb @@ -126,7 +126,7 @@ module ActiveRecord parent_records.each do |parent_record| association_proxy = parent_record.send(reflection_name) association_proxy.loaded - association_proxy.target.push(*Array.wrap(associated_record)) + association_proxy.target = association_proxy.target | [*Array.wrap(associated_record)] association_proxy.__send__(:set_inverse_instance, associated_record, parent_record) end |