The eager_each plugin makes calling each on an eager loaded dataset do eager loading. By default, each does not work on an eager loaded dataset, because each iterates over rows of the dataset as they come in, and to eagerly load you need to have all values up front. With the default associations code, you must call # on an eagerly loaded dataset, as calling # on an # dataset skips the eager loading, and calling # on an # dataset makes it yield plain hashes with columns from all tables, instead of yielding the instances of the main model.
This plugin makes # call # for eagerly loaded datasets. As # usually calls #, this is a bit of issue, but this plugin resolves the issue by cloning the dataset and setting a new flag in the cloned dataset, so that each can check with the flag to determine whether it should call all.
Usage:
# Make all model subclass instances eagerly load for each (called before loading subclasses) Sequel::Model.plugin :eager_each # Make the Album class eagerly load for each Album.plugin :eager_each
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.