method
find_sti_class
v7.1.3.2 -
Show latest stable
- Class:
ActiveRecord::Inheritance::ClassMethods
find_sti_class(type_name)private
No documentation available.
# File activerecord/lib/active_record/inheritance.rb, line 309
def find_sti_class(type_name)
type_name = base_class.type_for_attribute(inheritance_column).cast(type_name)
subclass = sti_class_for(type_name)
unless subclass == self || descendants.include?(subclass)
raise SubclassNotFound, "Invalid single-table inheritance type: #{subclass.name} is not a subclass of #{name}"
end
subclass
end