nesquena/rabl — pull request #343 by jackquack (2012-10-15 22:52:23+00:00)
Title: Bad keys used for caching

The issue I was having was that templates will render fine when fed an AR relation, since they respond fine to each. But when you try to use one as a key in caching, it doesn't end well

"rabl/1/#//json"

That is just one example of the keys I was ending up with in my cache. The solution is to unpack the relations in to regular arrays.
I didn't really see a good place for this logic, so I just placed the code as close as I could to AS.

Also, I see it as more of an error with the "ActiveSupport::Cache.expand_cache_key" function, but I'd rather fix it in Rabl than in AS since I can more easily fix unexpected side-effects should any appear. And, perhaps the function is actually working the way AS intends, but I don't have the time to look in to that.