instance method
base_class
Ruby on Rails 3.2.22.5
Since v3.2.22.5 Last seen in v6.1.7.10Signature
base_class()
Returns the base AR subclass that this class descends from. If A extends AR::Base, A.base_class will return A. If B descends from A through some arbitrarily deep hierarchy, B.base_class will return A.
If B < A and C < B and if A is an abstract_class then both B.base_class and C.base_class would return B as the answer since A is an abstract_class.
Source
# File activerecord/lib/active_record/inheritance.rb, line 42
def base_class
class_of_active_record_descendant(self)
end
Defined in activerecord/lib/active_record/inheritance.rb line 42
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Inheritance::ClassMethods