aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorJakub Kuźma <qoobaa@gmail.com>2011-12-21 15:28:24 +0100
committerJakub Kuźma <qoobaa@gmail.com>2011-12-21 21:10:15 +0100
commit1ad0a5363bcf44da9ed51e30c5c47a83c3516c24 (patch)
tree1c1a9464c3e7f58e812c0cb1352f58d68fce4ae9 /activerecord/lib/active_record/associations
parent618cb4429191290b957391c314a55b4d59f381f3 (diff)
downloadrails-1ad0a5363bcf44da9ed51e30c5c47a83c3516c24.tar.gz
rails-1ad0a5363bcf44da9ed51e30c5c47a83c3516c24.tar.bz2
rails-1ad0a5363bcf44da9ed51e30c5c47a83c3516c24.zip
added failing tests for has_many, has_one and belongs_to associations with strict mass assignment sanitizer, fixed build_record to not merge creation_attributes, removed failing nested attributes tests (that feature was broken anyway) #4051
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/association.rb7
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