Method: Sequel::Plugins::StaticCache::ClassMethods#each

Defined in:
lib/sequel/plugins/static_cache.rb

#each(&block) ⇒ Object

Yield each of the model’s frozen instances to the block, without issuing a database query.


117
118
119
120
121
122
123
# File 'lib/sequel/plugins/static_cache.rb', line 117

def each(&block)
  if @static_cache_frozen
    @all.each(&block)
  else
    @all.each{|o| yield(static_cache_object(o))}
  end
end