module Sequel::Plugins::ForbidLazyLoad::ForbidByDefault

  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
198 def each
199   if row_proc
200     super do |obj|
201       obj.forbid_lazy_load if obj.is_a?(InstanceMethods)
202       yield obj
203     end
204   else
205     super
206   end
207 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
210 def with_sql_each(sql)
211   if row_proc
212     super(sql) do |obj|
213       obj.forbid_lazy_load if obj.is_a?(InstanceMethods)
214       yield obj
215     end
216   else
217     super
218   end
219 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
222 def with_sql_first(sql)
223   obj = super
224   obj.allow_lazy_load if obj.is_a?(InstanceMethods)
225   obj
226 end