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
This commit is contained in:
David Heinemeier Hansson
2006-02-03 18:20:19 +00:00
parent 6d7b0374d1
commit 05eb14d55a
2 changed files with 3 additions and 1 deletions

View File

@@ -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]

View File

@@ -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)