Permalink
Browse files

Further improvement to the documentation of has_many method collectio…

…n.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.
  • Loading branch information...
1 parent 44e8f7c commit 3eeb0df402d3ba01f4237f0ccdeb086422af2314 Dave Rothlisberger committed Dec 28, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/associations.rb
@@ -772,7 +772,7 @@ module ClassMethods
# 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
# <tt>has_many :clients</tt> would add among others <tt>clients.empty?</tt>.)

0 comments on commit 3eeb0df

Please sign in to comment.