diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-05-09 19:35:34 -0700 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-05-16 17:24:58 -0700 |
commit | 0f4359252fa08dfc30de21aca329cb27eddfaee5 (patch) | |
tree | 0c262a420dcae486f223e1c456a5d6cd3653067b /activerecord/lib/active_record | |
parent | e3033e3b49cf0577221ca30e4d5507edd2802029 (diff) | |
download | rails-0f4359252fa08dfc30de21aca329cb27eddfaee5.tar.gz rails-0f4359252fa08dfc30de21aca329cb27eddfaee5.tar.bz2 rails-0f4359252fa08dfc30de21aca329cb27eddfaee5.zip |
Fix CollectionAssociation#replace to return new target (closes #6231)
Conflicts:
activerecord/test/cases/associations/has_many_associations_test.rb
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 0f32ce7bd4..3e853454a8 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -481,6 +481,8 @@ module ActiveRecord raise RecordNotSaved, "Failed to replace #{reflection.name} because one or more of the " \ "new records could not be saved." end + + new_target end def concat_records(records) |