diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-10 11:18:16 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-10 11:18:16 +0200 |
commit | 5fc3564a5021909384d2b762d125e521683403f1 (patch) | |
tree | e6c4d6dc293db642136c3b124e224fe68bf11447 /activerecord/lib | |
parent | 0ceb21e3354a7cec0c56effdd7a5917f7fa3b564 (diff) | |
download | rails-5fc3564a5021909384d2b762d125e521683403f1.tar.gz rails-5fc3564a5021909384d2b762d125e521683403f1.tar.bz2 rails-5fc3564a5021909384d2b762d125e521683403f1.zip |
Fix #480. Passing nil to create association works.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 270b43cd5d..85a4f47b7d 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -423,7 +423,7 @@ module ActiveRecord end def build_record(attributes, options) - reflection.build_association(scoped.scope_for_create.merge(attributes), options) + reflection.build_association(scoped.scope_for_create.merge(attributes || {}), options) end def delete_or_destroy(records, method) |