Ahsizara/cached_resource — pull request #3 by samsonw (2012-04-09 12:34:37+00:00)
Title: return the resource with the same persistence in cache

The returned cache version of the AR object seems not keep the @persisted attribute, this somehow cause a weird routing issue in rails 3.1.1 (We used this in a real world application, haven't tested in other versions of rails though).

A contrived example is user_path(current_user) will work perfectly if current_user returns a object with persisted? true, but will fail with no routing match error if persisted? false. That's why we want to keep the persisted? attribute.