#797 open
Iain

Validation on accessible associations creates strange error messages

Reported by Iain | September 24th, 2010 @ 06:40 AM | in Hobo 1.1

I have a test app with a Sack model that "has many" Cats, and this association is accessible. If I edit the Cats on an existing Sack (from the Sack edit page) and validation fails on one of the cats, I get the garbage error message that you can see in the attached screenshot.

I haven't found the cause of the problem, but I can see where it's coming from. As part of the accessible association code, if there are validation errors on an model in an association then the association will be given ... as the validation error message (see hobo/include_in_save.rb:27 and hobo/accessible_associations.rb:55). This only occurs if either the containing/parent model or the contained/child model already exists (see hobo/accessible_associations.rb:45). But somewhere between the error message (...) being added and <error-messages> outputting it it is converted into garbage (it looks like a concatenation of all of the default rails validation error messages). If I change ... to anything else (eg. ***) then the the problem goes away (this also requires changing the code in <error-messages> to ignore ***).

The app I get this in is a very basic test app, using hobo 1.0.1 and rails 2.3.4. The error might be down to using that particular version of rails.

Comments and changes to this ticket

  • Bryan Larsen

    Bryan Larsen November 15th, 2010 @ 09:42 PM

    • State changed from “new” to “open”
    • Milestone set to Hobo 1.1
    • Tag changed from associations, hobo to associations, hobo, needs-test-case
    • Milestone order changed from “197888” to “0”

    Would you mind putting that very basic test app up on github? Thanks.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages