I've encountered a need to use the previous state of the model, before all 
the changes were made.

I fantasized about something like:
model.was
or 
model.before_changes

Also, a nice method to have is 'revert_changes', that reverts all the 
changes (without reloading the model from DB).

Alternatively:
revert_changes would be the first method I suggested (reverting changes 
without changing the object), and:
revert_changes! would be the second one (reverting changes on the object 
itself).

I would like to make a pull request.

implementing the second one is easy - I just loop through changes and undo 
them.
First one is harder because we need another instance of the model, maybe 
I'll use 'dup' method?

ideas, thoughts?

Thanks

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to