Fix an issue with serialized attribute

Fixes https://github.com/Shopify/identity_cache/issues/113
Related https://github.com/rails/rails/issues/13861