mhgbrown / cached_resource

Caching for ActiveResource
MIT License
80 stars 28 forks source link

return the resource with the same persistence in cache #3

Closed samsonw closed 12 years ago

samsonw commented 12 years ago

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.

mhgbrown commented 12 years ago

Cool! I'll get this in there ASAP.

mhgbrown commented 12 years ago

7bfe306d918dd90f9028b6770861bc9fa2bc7988