mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user