Method: ActiveRecord::ModelSchema::ClassMethods#inheritance_column
- Defined in:
- lib/active_record/model_schema.rb
#inheritance_column ⇒ Object
Defines the name of the table column which will store the class name on single-table inheritance situations.
The default inheritance column name is type, which means it’s a reserved word inside Active Record. To be able to use single-table inheritance with another column name, or to use the column type in your own model for something else, you can set inheritance_column:
self.inheritance_column = 'zoink'
159 160 161 |
# File 'lib/active_record/model_schema.rb', line 159 def inheritance_column (@inheritance_column ||= nil) || superclass.inheritance_column end |