
validates_present :association, fails silently
Reported by Justin Smestad | December 19th, 2008 @ 04:16 PM | in 0.10.0
When using validates_present on an association, it will properly refuse object creation but will not propagate any error up to merb (in this case). This poses a problem as the next line will evaluate nil.accessor and throw an error there (making it cryptic about what had failed).
This can be recreated by using my merbherd source (and adding validation requirements).
Comments and changes to this ticket
-
Dan Kubb (dkubb) January 8th, 2009 @ 02:44 PM
- Assigned user set to Michael Klishin (antares)
-
Michael Klishin (antares) March 25th, 2009 @ 04:59 PM
- Milestone set to 0.10.0
- State changed from unconfirmed to confirmed
-
Michael Klishin (antares) March 28th, 2009 @ 10:11 AM
- State changed from confirmed to accepted
What does "propagate error to Merb" mean in this context? Just add error message to errors list?
-
Michael Klishin (antares) March 29th, 2009 @ 10:15 AM
- State changed from accepted to resolved
Just pushed example for association validation. Spec suite only has n:1 right now but validator uses @ivar so it should work identically.
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »