Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong data being cached when ActiveRecord.where call returns objects in a different order than cache_keys and ids #3

Open
mitya777 opened this issue Apr 26, 2020 · 0 comments

Comments

@mitya777
Copy link

Model.where({ids: ids } does not return objects in the same order as ids.

This causes the zip call to zip together the wrong data with the wrong cache keys https://github.com/justinweiss/bulk_cache_fetcher/blob/master/lib/bulk_cache_fetcher.rb#L75

This is not technically a problem with this code because it is the provided block's responsibility to provide the data to cache, but the example and docs make it seem as though this would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant