method
association_klass
v3.2.13 -
Show latest stable
- Class:
ActiveRecord::Associations::Preloader
association_klass(reflection, record)private
No documentation available.
# File activerecord/lib/active_record/associations/preloader.rb, line 158
def association_klass(reflection, record)
if reflection.macro == :belongs_to && reflection.options[:polymorphic]
klass = record.send(reflection.foreign_type)
klass && klass.constantize
else
reflection.klass
end
end