# STI and inheritance "type" column class naming

**URL:** <https://www.ruby-forum.com/t/sti-and-inheritance-type-column-class-naming/128592>\
**Category:** Rails\
**Created:** [February 9, 2008, 2:46am UTC](https://www.ruby-forum.com/t/sti-and-inheritance-type-column-class-naming/128592 "2008-02-09T02:46:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 9, 2008, 2:46am UTC](https://www.ruby-forum.com/t/sti-and-inheritance-type-column-class-naming/128592/1 "2008-02-09T02:46:24Z")

</div>

I am running Rails 1.2.6.

I am using a polymorphic association on a belongs to.

My model itself is inherited from another A:R class. When my model  
gets saved its base class name gets saved, versus its “real” class  
name. This has been detailed on the FAQ at:

[http://wiki.rubyonrails.org/rails/pages/UnderstandingPolymorphicAssociations](http://wiki.rubyonrails.org/rails/pages/UnderstandingPolymorphicAssociations)

Under the question “Why is record.class.base-class stored as the  
foreign-type, instead of just record.class?”.

A bug has been filed on this: [http://dev.rubyonrails.org/ticket/6485](http://dev.rubyonrails.org/ticket/6485)

The bug ticket above contains some patches to fix this, however, I  
REALLY do not want to patch my Rails core. Plus, when I applied that  
patch only 3 out of 5 patches succeeded. I guess I could try and fix  
the other two by hand. At this point it just seems messy.

Are there any other solutions? Or I am screwed?

Thanks  
-Rupert
