Method: ActiveRecord::Inheritance::ClassMethods#abstract_class
- Defined in:
- activerecord/lib/active_record/inheritance.rb
#abstract_class ⇒ Object
Set this to true if this is an abstract class (see abstract_class?
). If you are using inheritance with ActiveRecord and don’t want child classes to utilize the implied STI table name of the parent class, this will need to be true. For example, given the following:
class SuperClass < ActiveRecord::Base
self.abstract_class = true
end
class Child < SuperClass
self.table_name = 'the_table_i_really_want'
end
self.abstract_class = true
is required to make Child<.find,.create, or any Arel method>
use the_table_i_really_want
instead of a table called super_classes
90 91 92 |
# File 'activerecord/lib/active_record/inheritance.rb', line 90 def abstract_class @abstract_class end |