From 3eeb0df402d3ba01f4237f0ccdeb086422af2314 Mon Sep 17 00:00:00 2001 From: Dave Rothlisberger Date: Mon, 28 Dec 2009 14:33:26 +0000 Subject: Further improvement to the documentation of has_many method collection.create: Of course the "associated object" (base model) cannot be nil, or you wouldn't be calling this method on it. What concerns the user is that the base model must be present in the DB. --- activerecord/lib/active_record/associations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 56d13a4303..d90dcf090e 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -772,7 +772,7 @@ module ActiveRecord # Returns a new object of the collection type that has been instantiated # with +attributes+, linked to this object through a foreign key, and that has already # been saved (if it passed the validation). *Note*: This only works if the base model - # already exists, not if it's +nil+ or is a new (unsaved) record! + # already exists in the DB, not if it is a new (unsaved) record! # # (*Note*: +collection+ is replaced with the symbol passed as the first argument, so # has_many :clients would add among others clients.empty?.) -- cgit v1.2.3