Closed jefflunt closed 12 years ago
So far so good, but there is a cascading issue. When an record is destroyed, the sub-records are also destroyed (or marked as deleted). What we want to do instead is just mark the parent object as deleted.
Also, the dependent: destroy
relationships need to be lifted. This will probably handle the issue, actually.
Commit fed4c9d is actually related to this issue.
Deployed.
When you try to delete something, it should mark it as deleted (which hides it from the view, as opposed to actually deleting it), and allow you to restore it if you want.
The current thinking:
The "flash" message section at the top of the page should provide an "undo" link to undo the more recently trashed item.
The gem
paranoia
should take care of this. https://github.com/radar/paranoia - it automatically scopes all your queries (by default) to exclude "deleted_at" records.