尝试使用 JOIN 急切加载多态关联时引发此错误。急切加载多态关联仅可通过 ActiveRecord::Relation#preload 实现。
方法
- N
类公共方法
new(reflection = nil) 链接
源代码:显示 | 在 GitHub 上
# File activerecord/lib/active_record/associations.rb, line 244 def initialize(reflection = nil) if reflection super("Cannot eagerly load the polymorphic association #{reflection.name.inspect}") else super("Eager load polymorphic error.") end end