I want to use Single Table Inheritance using a column other than type
. According to the Rails documentation - http://api.rubyonrails.org/classes/ActiveRecord/Base.html, I can do this by modifying ActiveRecord::Base.inheritance_column
. How can I do this?
Asked
Active
Viewed 6,696 times
12

Bryan Ash
- 4,385
- 3
- 41
- 57

Eric Baldwin
- 3,341
- 10
- 31
- 71
1 Answers
19
Try the following:
class MyModel < ActiveRecord::Base
self.inheritance_column = 'column_that_is_not_type'
end
Your migrations should work everywhere.

Vidya
- 29,932
- 7
- 42
- 70