This may have to do with how Hobo is going about saving the record under the
hood.  Unless I'm mistaken, (and I can't remember exactly which method
behaves this way) but when you save an object in activerecord with an
association, there is a case where the association's validation is bypassed.
 I thought it was mentioned in this article on new, create, and build
methods in Rails:
http://blog.mrbrdo.net/2009/10/27/ruby-on-rails-new-vs-create-vs-build/, but
after re-reading it I couldn't find mention of this.  My foggy memory is
that its when you use create, so you could pop open the Hobo gem and see how
the save happens, or try bypassing the Hobo save method altogether (although
thats obviously not a very Hobo-idea).

Of course, I could be entirely off.

On Sat, May 8, 2010 at 7:52 AM, storitel <[email protected]> wrote:

> hi chaps - noob again :-)
>
> i have a contact model, belongs to company. i have validations working
> - so on the contact new action it's not possible to create a contact
> with empty name etc.
>
> but if i have a new contact form on the company show page, the
> validations aren't triggered... as soon as I hit add with an empty
> name the app proceeds until an exception is thrown. is there some
> special plumbing required for validations on child forms?
>
> br
> paul
>
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<hobousers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to