Module: Mongoid::Undo
- Extended by:
- ActiveSupport::Concern
- Includes:
- Callbacks, Paranoia, Versioning
- Defined in:
- lib/mongoid/undo.rb,
lib/mongoid/undo/version.rb
Constant Summary collapse
- VERSION =
'0.10.1'
Instance Method Summary collapse
- #undo ⇒ Object (also: #redo)
Instance Method Details
#undo ⇒ Object Also known as: redo
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/mongoid/undo.rb', line 29 def undo run_callbacks __callee__ do case action when :create, :destroy deleted_at.present? ? restore : delete when :update retrieve end end end |