redhotlabs/identity_cache — pull request #1 by fffanatics (2014-04-24 23:44:33+00:00)
Title: Adding cache options and custom ttl's to active record objects

I added cache_options to fetch and fetch_multi, these were the only two functions that called cache.write. In this case, the "cache" object is a memoized_cache_proxy. I had to modify that too in order to allow options to go through.

It definitely works and all we have to do on our active records objects is something like this:

include IdentityCache
cache_version 2
cache_ttl 1.week

I realize we could probably change the cache_ttl option to something like "cache_options" and you pass in a hash of options, but I wanted to make it more explicit. I can go either way though, it's not hard to change.