fix: Rails 7 preloader now take named arguments

This commit is contained in:
Nicolas Cavigneaux 2023-03-06 16:12:34 +01:00 committed by Colin Darie
parent b478168e23
commit 8f6beb1093
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -42,7 +42,10 @@ module Loaders
end
def preload_association(records)
::ActiveRecord::Associations::Preloader.new.preload(records, @association_schema)
::ActiveRecord::Associations::Preloader.new(
records: records,
associations: @association_schema
).call
end
def read_association(record)