Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix #480. Passing nil to create association works.

  • Loading branch information...
commit 5fc3564a5021909384d2b762d125e521683403f1 1 parent 0ceb21e
José Valim josevalim authored
2  activerecord/lib/active_record/associations/collection_association.rb
View
@@ -423,7 +423,7 @@ def insert_record(record, validate = true)
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)
Please sign in to comment.
Something went wrong with that request. Please try again.