Say I have a basic Rails app with a basic one-to-many relationship where each comment belongs to an article:
$ rails blog $ cd blog $ script/generate model a
Instead of validating the presence of the article's id you could validate the presence of the article.
validates_presence_of :article
Then when you are creating your comment:
article.comments.build :article => article