Sha256: c0ae986ea3a53201a01bb299cea34106dd7eb06d6918690415f9a634d09da095

Contents?: true

Size: 354 Bytes

Versions: 21

Compression:

Stored size: 354 Bytes

Contents

# frozen_string_literal: true

module N1Loader
  module ArLazyPreload
    # A patch to {N1Loader::Loader} to setup lazy context lazily.
    module LoaderPatch
      attr_accessor :context_setup

      def loaded
        return @loaded if @loaded

        super

        context_setup&.call(preloaded_records)

        @loaded
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
n1_loader-1.7.4 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.7.3 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.7.2 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.7.1 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.7.0 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.6.6 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.6.5 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.6.4 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.6.3 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.6.2 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.6.1 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.6.0 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.5.1 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.5.0 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.4.4 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.4.3 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.4.2 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.4.1 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.4.0 lib/n1_loader/ar_lazy_preload/loader_patch.rb
n1_loader-1.3.0 lib/n1_loader/ar_lazy_preload/loader_patch.rb