From e2a070cf47fb9a845ecf53ff2f437390598fe0b7 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Wed, 9 May 2012 19:35:34 -0700 Subject: Fix CollectionAssociation#replace to return new target (closes #6231) --- activerecord/lib/active_record/associations/collection_association.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 00321ec860..56ec4c5c23 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -468,6 +468,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) -- cgit v1.2.3