Skip to content

Commit

Permalink
Merge pull request #147 from Shopify/fix-rails-7-deprecation-warning
Browse files Browse the repository at this point in the history
Fix AssociationLoader Rails 7 Deprecation Warning
  • Loading branch information
swalkinshaw authored Dec 20, 2021
2 parents 247a748 + 726bcb6 commit 33bd992
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/association_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def validate
end

def preload_association(records)
::ActiveRecord::Associations::Preloader.new.preload(records, @association_name)
::ActiveRecord::Associations::Preloader.new(records: records, associations: @association_name).call
end

def read_association(record)
Expand Down

0 comments on commit 33bd992

Please sign in to comment.