Exception: ActiveRecord::EagerLoadPolymorphicError
- Inherits:
-
ActiveRecordError
- Object
- StandardError
- ActiveRecordError
- ActiveRecord::EagerLoadPolymorphicError
- Defined in:
- 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.
Instance Method Summary collapse
-
#initialize(reflection = nil) ⇒ EagerLoadPolymorphicError
constructor
A new instance of EagerLoadPolymorphicError.
Constructor Details
#initialize(reflection = nil) ⇒ EagerLoadPolymorphicError
Returns a new instance of EagerLoadPolymorphicError.
163 164 165 166 167 168 169 |
# File '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 |