Class: ActiveRecord::Undo::UndoLog
- Inherits:
-
Base
- Object
- Base
- ActiveRecord::Undo::UndoLog
- Defined in:
- lib/active_record/undo/undo_log.rb
Instance Method Summary collapse
-
#restore! ⇒ Object
Restores all records associated with this deletion batch.
Instance Method Details
#restore! ⇒ Object
Restores all records associated with this deletion batch
12 13 14 15 16 17 18 |
# File 'lib/active_record/undo/undo_log.rb', line 12 def restore! transaction do # Reverse order ensures child records are restored before or after parents as needed undo_log_items.reverse_each(&:restore_item!) destroy! # Clean up log after successful restoration end end |