From 6abb779888112d94dd0b97151b7e3b04a2f770eb Mon Sep 17 00:00:00 2001 From: PhilipDeFraties Date: Tue, 24 Dec 2024 14:40:22 -0700 Subject: [PATCH] update syntax for preloader object initialization in Thread#nested_comments_for --- lib/classes/thread.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/classes/thread.rb b/lib/classes/thread.rb index 93f0f657a..6442598b0 100644 --- a/lib/classes/thread.rb +++ b/lib/classes/thread.rb @@ -153,8 +153,10 @@ def nested_comments_for(user, comments, show_all) ).tap do |nested_comments| next unless is_votable? - ActiveRecord::Associations::Preloader.new.preload( - nested_comments.flatten, :votes_for, ActsAsVotable::Vote.where(voter: user) + ActiveRecord::Associations::Preloader.new( + records: nested_comments.flatten, + associations: :votes_for, + scope: ActsAsVotable::Vote.where(voter: user) ) end end