Module: Sequel::Plugins::ForbidLazyLoad::ClassMethods
- Defined in:
- lib/sequel/plugins/forbid_lazy_load.rb
Instance Method Summary collapse
- 
  
    
      #allow_lazy_load_for_static_cache_associations  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    If the static_cache plugin is used by the associated class for an association, allow lazy loading that association, since the lazy association load will use a hash table lookup and not a query. 
- 
  
    
      #finalize_associations  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Allow lazy loading for static cache associations before finalizing. 
Instance Method Details
#allow_lazy_load_for_static_cache_associations ⇒ Object
If the static_cache plugin is used by the associated class for an association, allow lazy loading that association, since the lazy association load will use a hash table lookup and not a query.
| 126 127 128 129 130 131 132 133 134 135 136 | # File 'lib/sequel/plugins/forbid_lazy_load.rb', line 126 def allow_lazy_load_for_static_cache_associations # :nocov: if defined?(::Sequel::Plugins::StaticCache::ClassMethods) # :nocov: @association_reflections.each_value do |ref| if ref.associated_class.is_a?(::Sequel::Plugins::StaticCache::ClassMethods) ref[:forbid_lazy_load] = false end end end end | 
#finalize_associations ⇒ Object
Allow lazy loading for static cache associations before finalizing.
| 139 140 141 142 | # File 'lib/sequel/plugins/forbid_lazy_load.rb', line 139 def finalize_associations allow_lazy_load_for_static_cache_associations super end |