method

association_klass

rails latest stable - Class: ActiveRecord::Associations::Preloader

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.0.2) is shown here.

association_klass(reflection, record)
private

No documentation available.

# 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