Forum: Ruby on Rails Rolling up validates_associated error messages into parent

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Wes G. (Guest)
on 2007-03-30 22:06
All,

I really dig using validates_associated on my models to automatically
validate their associated objects.

However, I find that I would prefer that the associated object's error
messages were propagated up to the original (object on which validate
was called) object as they are, instead of the original object showing
"X is invalid" where X is one of the associated objects.

I've handled this "by hand" by massaging the errors array to remove
"...is invalid" messages and pulling the full error messages off the
associated objects and putting them on the original object.

Does anyone have a more clever way/patch to do this?  Any chance that
this may become an option on validates_associated in the future?

Thanks,
Wes
This topic is locked and can not be replied to.