From 46ea0affec11ca1d5fac2e8bb239f83468987fcc Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Fri, 2 Aug 2024 11:23:45 -0400 Subject: [PATCH] pass all parameters to preloader children --- lib/active_record/virtual_attributes/virtual_fields.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_record/virtual_attributes/virtual_fields.rb b/lib/active_record/virtual_attributes/virtual_fields.rb index c10b9e9..3e7f5d4 100644 --- a/lib/active_record/virtual_attributes/virtual_fields.rb +++ b/lib/active_record/virtual_attributes/virtual_fields.rb @@ -161,7 +161,7 @@ def call Array.wrap(klass_associations).each do |klass_association| # this calls back into itself, but it will take the short circuit - Preloader.new(:records => klass_records, :associations => klass_association, :scope => scope).call + Preloader.new(:records => klass_records, :associations => klass_association, :scope => scope, :available_records => @available_records, :associate_by_default => @associate_by_default).call end end end