Don’t call all when attempting to load the columns.
# File lib/sequel/plugins/eager_each.rb, line 33 def columns! if use_eager_all? clone(:all_called=>true).columns! else super end end
Handle eager loading when calling first and related methods. For eager_graph, this does an additional query after retrieving a single record, because otherwise the associated records won’t get eager loaded correctly.
# File lib/sequel/plugins/eager_each.rb, line 64 def single_record! if use_eager_all? obj = clone(:all_called=>true).all.first if opts[:eager_graph] obj = clone(:all_called=>true).where(obj.qualified_pk_hash).unlimited.all.first end obj else super end end