Method: Sequel::Plugins::ForbidLazyLoad::ClassMethods#allow_lazy_load_for_static_cache_associations
- Defined in:
- lib/sequel/plugins/forbid_lazy_load.rb
#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.
113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/sequel/plugins/forbid_lazy_load.rb', line 113 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 |