fix: Rails 7 preloader now take named arguments
This commit is contained in:
parent
b478168e23
commit
8f6beb1093
1 changed files with 4 additions and 1 deletions
|
@ -42,7 +42,10 @@ module Loaders
|
||||||
end
|
end
|
||||||
|
|
||||||
def preload_association(records)
|
def preload_association(records)
|
||||||
::ActiveRecord::Associations::Preloader.new.preload(records, @association_schema)
|
::ActiveRecord::Associations::Preloader.new(
|
||||||
|
records: records,
|
||||||
|
associations: @association_schema
|
||||||
|
).call
|
||||||
end
|
end
|
||||||
|
|
||||||
def read_association(record)
|
def read_association(record)
|
||||||
|
|
Loading…
Reference in a new issue