mongoid / mongoid-history

Multi-user non-linear history tracking, auditing, undo, redo for mongoid.
https://rubygems.org/gems/mongoid-history
MIT License
392 stars 129 forks source link

History tracker recording undo action as the last change.. #235

Open nishabeysinghe opened 4 years ago

nishabeysinghe commented 4 years ago

When we perform the undo action, is there a way to use undo action twice in a row ? In my experince when u perform the undo action, the next undo action becomes a redo because the history tracker records the undo action as the last action we did,, Is there any way to implement history tracker as a stack ?

dblock commented 4 years ago

This should be possible with some work. You can undo multiple changes with x.undo! :last => 3 today, but not by calling undo 3 times. I can see something like x.undo! :history => false or x.fundo! ;) PRs welcome!