flyerhzm/simple_cacheable — pull request #12 by ScotterC (2012-12-05 19:24:35+00:00)
Title: Fix has many through expiration

This got kind of ugly.

The wrong key was being deleted for a has_many association. It wasn't making the jump back through the 'through' association to eliminate the key associated with the original model.

This works but I'm worried about the reflection on the through association on line 90. I believe since it's the middle association between the two that it should always be the only one but I'm not 100% sure.

Also, the code got really ugly in order to interpolate the right values into the expire method. I haven't been metaprogramming for very long so I would welcome recommendations on DRYing it up