diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-21 12:16:13 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-21 12:16:13 -0800 |
commit | 1634cfa4475c902e649fa9e1c9a9231498b6579a (patch) | |
tree | df13b967f860ad5d8530867a52db286320930a13 /activerecord/lib/active_record | |
parent | 5a4b41443c09c1d1f5c996afe0838391b2e2c5f2 (diff) | |
parent | 1ad0a5363bcf44da9ed51e30c5c47a83c3516c24 (diff) | |
download | rails-1634cfa4475c902e649fa9e1c9a9231498b6579a.tar.gz rails-1634cfa4475c902e649fa9e1c9a9231498b6579a.tar.bz2 rails-1634cfa4475c902e649fa9e1c9a9231498b6579a.zip |
Merge pull request #4122 from qoobaa/mass_assignment_with_associated_object
added failing tests for has_many, has_one and belongs_to associations wi...
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/association.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index 861dda618a..7887d59aad 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -230,13 +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), - :without_protection => true - ) + record.assign_attributes(create_scope.except(*record.changed), :without_protection => true) end end end |