Sha256: a78d8b4063f5e709185fd0ea530a467d64e4558610644635f741543151f7f318
Contents?: true
Size: 568 Bytes
Versions: 7
Compression:
Stored size: 568 Bytes
Contents
# frozen_string_literal: true module ArLazyPreload # ActiveRecord::AssociationRelation patch for setting up lazy_preload_values based on # owner context module AssociationRelation def initialize(*args) super(*args) context = owner.lazy_preload_context return if context.nil? association_tree_builder = AssociationTreeBuilder.new(context.association_tree) subtree = association_tree_builder.subtree_for(reflection.name) lazy_preload!(subtree) end delegate :owner, :reflection, to: :proxy_association end end
Version data entries
7 entries across 7 versions & 1 rubygems