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

Version Path
motor-admin-0.2.34 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.33 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.32 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.31 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.30 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.29 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.28 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.27 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.26 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.25 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.24 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.23 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.22 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.21 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.20 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.19 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.18 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.17 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.16 lib/motor/active_record_utils/ar_lazy_preload_patch.rb
motor-admin-0.2.15 lib/motor/active_record_utils/ar_lazy_preload_patch.rb