On Nov 20, 9:59 pm, "Todd A. Jacobs" <tjacobs-sndr- [email protected]> wrote: > On Fri, Nov 20, 2009 at 09:51:27AM -0800, Darian Shimy wrote: > > Did you look at validates_associated > Is there a way to force the test to be more verbose when evaluating > validations, especially those which take place in other models? I'm at a > bit of a loss to understand why a simple 'validates_associated :user' > doesn't work, but I'll bet a more detailed trace would shine a light on > it. >
Well as the docs say, "This validation will not fail if the association hasn‘t been assigned". validates_presence_of :user should do the truck (but if you want a cast iron guarantee, use a foreign key constraint) Fred > -- > "Oh, look: rocks!" > -- Doctor Who, "Destiny of the Daleks" -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.

