Re: ActiveRecord bottom half

Bill Walton
2007-07-07T19:17:51Z

Hi Perry,

Perry Smith wrote:
> Please see:
>
> http://www.ruby-forum.com/topic/113189#new
>
> I may have discovered the error of my ways.  Instead of
> validates_presence_of, should I be using validates_associated ?

What you don''t say in your post above is whether or not you''re
getting the
results you expect.  If it accomplishes what you''re trying to
accomplish,
use it.  Rails typically gives us more than one way to "skin the cat."
Without knowing what you''re trying to accomplish it''s not
possible to say
whether or not there''s an easier / more Railsy way to do it.  I assume
you''ve reviewed the documentation on validates_associated at
http://api.rubyonrails.org and seen the note re: the potential need to use
validates_presence_of on the association itself.

Best regards,
Bill