class method self.inheritance_column

Ruby on Rails 8.1.2

Since v7.0.10

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

inheritance_column

The name of the table column which stores 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'

If you wish to disable single-table inheritance altogether you can set inheritance_column to nil

self.inheritance_column = nil
Source
# File activerecord/lib/active_record/model_schema.rb, line 139
    

Defined in activerecord/lib/active_record/model_schema.rb line 139 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ModelSchema

Type at least 2 characters to search.

↑↓ navigate · open · esc close