0

Sometimes I need delete some data in rails:

Post.where(id: [123, 321]).delete_all

And I need backup the data in case something went wrong.

Is there any Gems or Code help me to do this? It should export to YAML file, backup all the data destroyed, and easy revert(import data again).

I already done the database level backup. what I need is model/object level backup.

4

1 回答 1

0

You can always use this:

https://github.com/goncalossilva/rails3_acts_as_paranoid

It will mark your records and delete them, but not really delete them, and gives you the possibility of recovering them.

于 2012-11-20T08:49:31.727 回答