# File lib/sequel/plugins/static_cache.rb 293 def primary_key_lookup(pk) 294 if o = cache[pk] 295 _static_cache_frozen_copy(o) 296 end 297 end
module Sequel::Plugins::StaticCache::ForbidLazyLoadClassMethods
Public Instance Methods
Source
# File lib/sequel/plugins/static_cache.rb 267 def cache_get_pk(pk) 268 primary_key_lookup(pk) 269 end
Do not forbid lazy loading for single object retrieval.
Source
# File lib/sequel/plugins/static_cache.rb 272 def first(*args) 273 if !defined?(yield) && args.empty? 274 if o = @all.first 275 _static_cache_frozen_copy(o) 276 end 277 else 278 super 279 end 280 end
Use static cache to return first arguments.
Calls superclass method
Private Instance Methods
Source
# File lib/sequel/plugins/static_cache.rb 286 def _static_cache_frozen_copy(o) 287 o = call(Hash[o.values]) 288 o.errors.freeze 289 o.freeze 290 end
Return a frozen copy of the object that does not have lazy loading forbidden.
Source
Do not forbid lazy loading for single object retrieval.