Is there a way to undo/revert any local changes to an Activerecord object. For example:
user = User.first
user.name # "Fred"
user.name = "Sam"
user.name_was # "Fred"
user.revert
user.name # "Fred"
I know I could do user.reload
but I shouldn't have to hit the database to do this since the old values are stored in the state of the object.
Preferably a Rails 3 solution.