Shopify/identity_cache — pull request #180 by fbogsany (2014-09-29 20:35:23+00:00)
Title: Add #read and #exists_in_identity_cache?

https://github.com/Shopify/shopify/pull/29456 shows a use-case for reading or checking existence of an entry in IDC without resolving a cache miss. `exists_with_identity_cache` is implemented as `!!fetch_by_id(id)`, so it will resolve a cache miss: https://github.com/Shopify/identity_cache/blob/master/lib/identity_cache/query_api.rb#L15

This adds `read(id)` and `exists_in_identity_cache?(id)` operations. `read` both deserializes & inflates ActiveRecord objects on a cache hit, while `exists_in_identity_cache?` only deserializes to check for cached-nil & cached-deleted.

@camilo, @Thibaut
/cc @Shopify/webscale