diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-02-03 18:20:19 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-02-03 18:20:19 +0000 |
commit | 05eb14d55a2e336b82a57b57c83fad2b64c9b0f5 (patch) | |
tree | c76a4c91765194e3e5e0b3681b9d321c37cf151a /activerecord | |
parent | 6d7b0374d12de2ddeaa9c3f896234111ed6bf8e2 (diff) | |
download | rails-05eb14d55a2e336b82a57b57c83fad2b64c9b0f5.tar.gz rails-05eb14d55a2e336b82a57b57c83fad2b64c9b0f5.tar.bz2 rails-05eb14d55a2e336b82a57b57c83fad2b64c9b0f5.zip |
Using AssociationCollection#build with arrays of hashes should call build, not create [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3525 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_association.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index bb56988f98..111d645ea9 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Using AssociationCollection#build with arrays of hashes should call build, not create [DHH] + * Remove definition of reloadable? from ActiveRecord::Base to make way for new Reloadable code. [Nicholas Seckar] * Fixed schema handling for DB2 adapter that didn't work: an initial schema could be set, but it wasn't used when getting tables and indexes #3678 [Maik Schmidt] diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb index 7d8f1c6b0c..6800f363dc 100644 --- a/activerecord/lib/active_record/associations/has_many_association.rb +++ b/activerecord/lib/active_record/associations/has_many_association.rb @@ -9,7 +9,7 @@ module ActiveRecord def build(attributes = {}) if attributes.is_a?(Array) - attributes.collect { |attr| create(attr) } + attributes.collect { |attr| build(attr) } else load_target record = @reflection.klass.new(attributes) |