Sha256: c09b81d834e6aff34730fd85766b0681fc0d5c2ca0fcbe7642f71e8f03a8e006
Contents?: true
Size: 855 Bytes
Versions: 26
Compression:
Stored size: 855 Bytes
Contents
# frozen_string_literal: true if Rails::VERSION::MAJOR == 7 module ArLazyPreload module Relation def preload_associations(records) preload = preload_values preload += includes_values unless eager_loading? scope = strict_loading_value ? ActiveRecord::Relation::StrictLoadingScope : nil preload.each do |associations| preloader_associations = ActiveRecord::Associations::Preloader.new(records: records, associations: associations, scope: scope).call preloader_associations.each do |preloader_association| handle_preloaded_records(preloader_association.preloaded_records) end end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems