aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-02-03 18:20:19 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-02-03 18:20:19 +0000
commit05eb14d55a2e336b82a57b57c83fad2b64c9b0f5 (patch)
treec76a4c91765194e3e5e0b3681b9d321c37cf151a /activerecord/lib/active_record/associations
parent6d7b0374d12de2ddeaa9c3f896234111ed6bf8e2 (diff)
downloadrails-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/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/has_many_association.rb2
1 files changed, 1 insertions, 1 deletions
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)