# inheritance\_column issues

**URL:** <https://discuss.rubyonrails.org/t/inheritance-column-issues/10353>\
**Category:** rubyonrails-talk\
**Created:** [March 16, 2007, 5:04pm UTC](https://discuss.rubyonrails.org/t/inheritance-column-issues/10353 "2007-03-16T17:04:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Aljord](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@Patrick\_Aljord](https://discuss.rubyonrails.org/u/Patrick_Aljord)\
**Post date:** [March 16, 2007, 5:04pm UTC](https://discuss.rubyonrails.org/t/inheritance-column-issues/10353/1 "2007-03-16T17:04:39Z")

</div>

hey all, I have a table like that: devices( id int(5) uid int(5) type varchar(5) )

this is my model:

class Rdevice \< ActiveRecord::Base set\_table\_name "devices" end

for legacy reason I cannot change the column names. So I get this error when I do Rdevice.find :all

"ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'uuid'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Rdevice.inheritance\_column to use another column for that information."

Any idea how I can fix it? I know there is a inheritance\_column function to overwrite it but I couldn't get it to work.

thanx in advance

Pat

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 15, 2010, 4:50am UTC](https://discuss.rubyonrails.org/t/inheritance-column-issues/10353/2 "2010-01-15T04:50:24Z")

</div>

Brian Cowdery wrote:

> Hi Patrick, so for your specific example...
> 
> > hey all, I have a table like that: devices( id int(5) uid int(5) type varchar(5) )
> 
> Your model should look like this
> 
> class Rdevice \< ActiveRecord::Base set\_table\_name "devices" set\_inheritance\_column :ruby\_type
> 
> # getter for the "type" column def device\_type &nbsp;&nbsp;self[:type] end
> 
> # setter for the "type" column def device\_type=(s) &nbsp;&nbsp;self[:type] = s end end
> 
> Enjoy! -Brian

Hi Brian,

That's a nice solution to the issue, even I was stuck with the same issue. It solved the inheritence\_column issue.

Thanks
