Sha256: 36e7f44a6ab502a8e848ca97c3c6e5025b4fba98790f63684c4c7ff5bf179c68

Contents?: true

Size: 322 Bytes

Versions: 12

Compression:

Stored size: 322 Bytes

Contents

# frozen_string_literal: true

# Returns cached N1Loader::LoaderCollection from context for a loader.
# In case there is none yet, saves passed block to a cache.
ArLazyPreload::Contexts::BaseContext.define_method :fetch_n1_loader_collection do |loader, &block|
  (@n1_loader_collections ||= {})[loader] ||= block.call
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
n1_loader-1.7.4 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.7.3 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.7.2 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.7.1 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.7.0 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.6.6 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.6.5 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.6.4 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.6.3 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.6.2 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.6.1 lib/n1_loader/ar_lazy_preload/context.rb
n1_loader-1.6.0 lib/n1_loader/ar_lazy_preload/context.rb