mongoid / mongoid-history

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

no-op on repeated calls to destroy #182

Closed msaffitz closed 7 years ago

msaffitz commented 7 years ago

Calling destroy multiple times on the same document attempts to track each deletion, which ultimately fails with a RuntimeError when updating the (frozen) attributes hash with the incremented version number. (This is especially problematic / difficult to track down for documents with cyclic relations and cascading destroys).

This no-ops tracking of destroy for documents that are already destroyed.

dblock commented 7 years ago

I've fixed the build in https://github.com/mongoid/mongoid-history/pull/183, rebase this please. Your changelog line needs to start with a capital letter too to make danger-changelog happy. Sorry about the hassle.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.0003%) to 99.749% when pulling 4cdd1de7ff83d0e0c234ea06a14592b8a90c8e0a on apptentive-engineering:noop_repeat_destroys into ccc733e4def02e68eb375873045fd73b6cb850a6 on mongoid:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.0003%) to 99.749% when pulling 4cdd1de7ff83d0e0c234ea06a14592b8a90c8e0a on apptentive-engineering:noop_repeat_destroys into ccc733e4def02e68eb375873045fd73b6cb850a6 on mongoid:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.0003%) to 99.749% when pulling 4cdd1de7ff83d0e0c234ea06a14592b8a90c8e0a on apptentive-engineering:noop_repeat_destroys into ccc733e4def02e68eb375873045fd73b6cb850a6 on mongoid:master.

msaffitz commented 7 years ago

@dblock no worries; rebased and Changelog fixed. Thanks for considering / merging.

dblock commented 7 years ago

Merged, thanks.