From 774ff18c095145f544e845dbb940378546748969 Mon Sep 17 00:00:00 2001 From: Andrew Kaspick Date: Wed, 14 Dec 2011 20:13:03 -0600 Subject: Allow nested attributes in associations to update values in it's owner object. Fixes a regression from 3.0.x --- activerecord/lib/active_record/associations/association.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/lib/active_record/associations/association.rb') diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index d1e3ff8e38..861dda618a 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -230,6 +230,8 @@ module ActiveRecord end def build_record(attributes, options) + attributes = (attributes || {}).reverse_merge(creation_attributes) + reflection.build_association(attributes, options) do |record| record.assign_attributes( create_scope.except(*record.changed), -- cgit v1.2.3