aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-09-26 10:41:11 +0100
committerJon Leighton <j@jonathanleighton.com>2011-09-26 10:41:58 +0100
commitb838059817aca490f78e3bb74a070729270300db (patch)
tree166e26d4689fa8a296765471aacb22f76e969491 /activerecord/lib/active_record
parent541018a07b6467bee5e22709ce7dc46880ea1ff4 (diff)
downloadrails-b838059817aca490f78e3bb74a070729270300db.tar.gz
rails-b838059817aca490f78e3bb74a070729270300db.tar.bz2
rails-b838059817aca490f78e3bb74a070729270300db.zip
CollectionProxy#replace should change the DB records rather than just mutating the array. Fixes #3020.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/collection_proxy.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb
index 6ba3d45aff..3181ca9a32 100644
--- a/activerecord/lib/active_record/associations/collection_proxy.rb
+++ b/activerecord/lib/active_record/associations/collection_proxy.rb
@@ -46,7 +46,7 @@ module ActiveRecord
delegate :select, :find, :first, :last,
:build, :create, :create!,
- :concat, :delete_all, :destroy_all, :delete, :destroy, :uniq,
+ :concat, :replace, :delete_all, :destroy_all, :delete, :destroy, :uniq,
:sum, :count, :size, :length, :empty?,
:any?, :many?, :include?,
:to => :@association