Shopify/identity_cache — pull request #88 by fbogsany (2013-09-12 22:15:47+00:00)
Title: Workaround serialized attributes bug

If a record has serialized attributes, record.init_with(coder) will modify coder to wrap the serialized attributes. When MemoizedCacheProxy is used, the coder persists for the duration of the request, so later calls to fetch will return the same coder instance and record.init_with(coder) will again modify the cached coder by re-wrapping the already wrapped serialized attributes.

This works around the modification of the cached coder by duplicating both the coder hash and its "attributes" hash before calling init_with if the record type has serialized attributes.

@camilo @hornairs for review