jefflunt / rpglogger

(retired) Build your own strategy guide for any RPG
6 stars 0 forks source link

Move things to trash #103

Closed jefflunt closed 12 years ago

jefflunt commented 12 years ago

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.

jefflunt commented 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.

jefflunt commented 12 years ago

Commit fed4c9d is actually related to this issue.

jefflunt commented 12 years ago

Deployed.