module Sequel::Plugins::ForbidLazyLoad::DatasetMethods

  1. lib/sequel/plugins/forbid_lazy_load.rb

Methods

Public Instance

  1. each
  2. with_sql_each
  3. with_sql_first

Public Instance methods

each()

Mark model instances retrieved in this call as forbidding lazy loading.

[show source]
    # File lib/sequel/plugins/forbid_lazy_load.rb
184 def each
185   if row_proc
186     super do |obj|
187       obj.forbid_lazy_load if obj.is_a?(InstanceMethods)
188       yield obj
189     end
190   else
191     super
192   end
193 end
with_sql_each(sql)

Mark model instances retrieved in this call as forbidding lazy loading.

[show source]
    # File lib/sequel/plugins/forbid_lazy_load.rb
196 def with_sql_each(sql)
197   if row_proc
198     super(sql) do |obj|
199       obj.forbid_lazy_load if obj.is_a?(InstanceMethods)
200       yield obj
201     end
202   else
203     super
204   end
205 end
with_sql_first(sql)

Mark model instances retrieved in this call as allowing lazy loading.

[show source]
    # File lib/sequel/plugins/forbid_lazy_load.rb
208 def with_sql_first(sql)
209   obj = super
210   obj.allow_lazy_load if obj.is_a?(InstanceMethods)
211   obj
212 end