module Sequel::Plugins::EagerEach::EagerDatasetMethods

  1. lib/sequel/plugins/eager_each.rb
Parent: EagerEach

Methods added to eagerly loaded datasets when the eager_each plugin is in use.

Methods

Public Instance

  1. all
  2. each

Public Instance methods

all (&block)

Clone the dataset and set a flag to let each know not to call all, to avoid the infinite loop.

[show source]
# File lib/sequel/plugins/eager_each.rb, line 37
def all(&block)
  if opts[:all_called]
    super
  else
    clone(:all_called=>true).all(&block)
  end
end
each (&block)

Call all instead of each unless each is being called by all.

[show source]
# File lib/sequel/plugins/eager_each.rb, line 27
def each(&block)
  if opts[:all_called]
    super
  else
    all(&block)
  end
end