If you want callbacks to trigger before a restore:
``` ruby
before_restore:callback_name_goes_here
```
For more information, please look at the tests.
For more information, please look at the tests.
#### About indexes:
#### About indexes:
...
@@ -221,6 +199,24 @@ You can replace the older `acts_as_paranoid` methods as follows:
...
@@ -221,6 +199,24 @@ You can replace the older `acts_as_paranoid` methods as follows:
The `recover` method in `acts_as_paranoid` runs `update` callbacks. Paranoia's
The `recover` method in `acts_as_paranoid` runs `update` callbacks. Paranoia's
`restore` method does not do this.
`restore` method does not do this.
## Callbacks
Paranoia provides few callbacks. It triggers `destroy` callback when the record is marked as deleted and `real_destroy` when the record is completely removed from database. It also calls `restore` callback when record is restored via paranoia
For example if you want to index you records in some search engine you can do like this: