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?
Try the following:
class MyModel < ActiveRecord::Base
self.inheritance_column = 'column_that_is_not_type'
end
Your migrations should work everywhere.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With