Sha256: 6c1ec553e0c16a699b4f4db8a29bd4760a18f05c039e26491d6cdca813a5fb36

Contents?: true

Size: 459 Bytes

Versions: 5

Compression:

Stored size: 459 Bytes

Contents

# frozen_string_literal: true

module N1Loader
  module ArLazyPreload
    # Context builder for N1Loader
    class AssociatedContextBuilder < ::ArLazyPreload::AssociatedContextBuilder
      def perform
        ::ArLazyPreload::Context.register(
          records: parent_context.records.flat_map(&association_name),
          association_tree: child_association_tree,
          auto_preload: parent_context.auto_preload?
        )
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
n1_loader-1.1.0 lib/n1_loader/ar_lazy_preload/associated_context_builder.rb
n1_loader-1.0.0 lib/n1_loader/ar_lazy_preload/associated_context_builder.rb
n1_loader-0.1.2 lib/n1_loader/ar_lazy_preload/associated_context_builder.rb
n1_loader-0.1.1 lib/n1_loader/ar_lazy_preload/associated_context_builder.rb
n1_loader-0.1.0 lib/n1_loader/ar_lazy_preload/associated_context_builder.rb