# Child to Parent Validation Errors

**URL:** <https://www.ruby-forum.com/t/child-to-parent-validation-errors/186609>\
**Category:** Rails\
**Created:** [April 9, 2010, 5:24pm UTC](https://www.ruby-forum.com/t/child-to-parent-validation-errors/186609 "2010-04-09T17:24:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smarter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9fc29f/32.png) [@smarter](https://www.ruby-forum.com/u/smarter)\
**Post date:** [April 9, 2010, 5:24pm UTC](https://www.ruby-forum.com/t/child-to-parent-validation-errors/186609/1 "2010-04-09T17:24:50Z")

</div>

Hi:

Passing child virtual attribute validation error to parent…  
in case of nested attributes.

So, I have a Parent Model say ‘Parent’.  
Nested Attributes it accepts for Child say ‘Child’

Now suppose there is a validate method in ‘Child’

and it has something like self.errors.add\_to\_base(“some message”).

How do you make sure that Parent gets this?

I thought it will be auto copied to Parent as in other normal class  
macros like validates\_presence\_of.

However, in this case I am loosing the message display from Child to  
Parent for this error.

Is there a manual copy method for Child to Parent?

This is for a Virtual Attribute added in Child, but just doing  
self.errors in Validate of Child, shouldn’t it be copied to Parent  
directly?

Thanks for any clarifications here.
