instance method
find_sti_class
Ruby on Rails 8.0.4
Since v3.2.22.5 PrivateSignature
find_sti_class(type_name)
No documentation comment.
Parameters
-
type_namereq
Source
# File activerecord/lib/active_record/inheritance.rb, line 311
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
Defined in activerecord/lib/active_record/inheritance.rb line 311
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Inheritance::ClassMethods