Permalink
Browse files

Using AssociationCollection#build with arrays of hashes should call b…

…uild, not create [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3525 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 6d7b037 commit 05eb14d55a2e336b82a57b57c83fad2b64c9b0f5 @dhh dhh committed Feb 3, 2006
Showing with 3 additions and 1 deletion.
  1. +2 −0 activerecord/CHANGELOG
  2. +1 −1 activerecord/lib/active_record/associations/has_many_association.rb
View
@@ -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 @@ 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)

0 comments on commit 05eb14d

Please sign in to comment.