Skip to content

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

Description

@mitya777

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions