class ActiveRecord::EagerLoadPolymorphicError

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

def initialize(reflection = nil)

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