123456789_123456789_123456789_123456789_123456789_

Exception: ActiveRecord::EagerLoadPolymorphicError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ActiveRecordError, StandardError
Instance Chain:
self, ActiveRecordError, StandardError
Inherits: ActiveRecord::ActiveRecordError
Defined in: activerecord/lib/active_record/associations.rb

Overview

This error is raised when trying to eager load a polymorphic association using a JOIN. Eager loading polymorphic associations is only possible with {ActiveRecord::Relation#preload}.

Class Method Summary

Constructor Details

.new(reflection = nil) ⇒ EagerLoadPolymorphicError

[ GitHub ]

  
# File 'activerecord/lib/active_record/associations.rb', line 163

def initialize(reflection = nil)
  if reflection
    super("Cannot eagerly load the polymorphic association #{reflection.name.inspect}")
  else
    super("Eager load polymorphic error.")
  end
end