# Parent's Validations lost via Inheritance

**URL:** <https://www.ruby-forum.com/t/parents-validations-lost-via-inheritance/142906>\
**Category:** Rails\
**Created:** [July 13, 2008, 6:29am UTC](https://www.ruby-forum.com/t/parents-validations-lost-via-inheritance/142906 "2008-07-13T06:29:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [July 13, 2008, 6:29am UTC](https://www.ruby-forum.com/t/parents-validations-lost-via-inheritance/142906/1 "2008-07-13T06:29:00Z")

</div>

I have some simple models that inherit from a parent (using STI). In  
all but one case, all of the validations are declared in the parent  
model like:

class InfoRequest \< ActiveRecord::Base  
validates\_presence\_of :full\_name,  
:email\_address,  
:phone\_number,  
:mailing\_address  
… etc …  
end

In one of the child models, I need to add one more validation rule (it  
has an extra attribute) like so:

class CreditInfoRequest \< InfoRequest  
validates\_acceptance\_of :auth\_to\_share  
end

Except doing this seems to blow away all my validations for this model.  
If I don’t declare any validations in the child model, the parent’s  
validations are inherited and run just fine. But the minute I add  
validations to the child, both it’s _and_ the inherited validations fail  
to run.

What?

BTW, I can get around this by overriding the validate method in the  
child model but that just bugs me.

Can someone shed some light on this?

-Chris
