Method: ActiveRecord::Inheritance::ClassMethods#polymorphic_class_for

Defined in:
activerecord/lib/active_record/inheritance.rb

#polymorphic_class_for(name) ⇒ Object

Returns the class for the provided name.

It is used to find the class correspondent to the value stored in the polymorphic type column.



218
219
220
221
222
223
224
# File 'activerecord/lib/active_record/inheritance.rb', line 218

def polymorphic_class_for(name)
  if store_full_class_name
    name.constantize
  else
    compute_type(name)
  end
end