method

association_klass

Importance_0
v4.0.2 - Show latest stable - 0 notes - Class: Preloader
association_klass(reflection, record) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations/preloader.rb, line 156
      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
Register or log in to add new notes.