Skip to content

Commit

Permalink
Merge pull request #85 from kofiasare-dev/UPDATE-README.md
Browse files Browse the repository at this point in the history
Update docs on using `BatchLoader` with `ActiveRecord` in multple places
  • Loading branch information
exAspArk authored Dec 20, 2023
2 parents 370fd53 + 01ff4c5 commit e7f18ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class Types::PreloadableField < Types::BaseField
return super unless @preloads

BatchLoader::GraphQL.for(type).batch(key: self) do |records, loader|
ActiveRecord::Associations::Preloader.new.preload(records.map(&:object), @preloads)
ActiveRecord::Associations::Preloader.new(records: records.map(&:object), associations: @preloads).call
records.each { |r| loader.call(r, super(r, args, ctx)) }
end
end
Expand Down

0 comments on commit e7f18ea

Please sign in to comment.