-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow the :eager_loader association proc to accept a single hash inst…
…ead of 3 arguments The previously supported API of using 3 separate arguments is still supported. However, the new API is more flexible, and is required to get access to the dataset that is doing the eager loading. That will be used in the future to make sure the sharding plugin works for eager loading. With the new API, the hash passed to the eager_loader proc is populated with the keys :key_hash, :rows, :associations, and :self, with the first three keys corresponding to the old argument order, and the new :self key being the dataset doing the eager loading. The Model.eager_loading_dataset method now also accepts an options hash as an optional fifth argument, which should be backwards compatible.
- Loading branch information
1 parent
3670ddc
commit 14e9bcd
Showing
9 changed files
with
119 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.