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.
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.