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
上级 6d7b0374
*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 @@ def initialize(owner, reflection)
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册