Deleted child status should be "deleted" not "published"!


(Epipheus) #1

For some reason a deleted child still has the status of “published,” why??? If it is deleted shouldn’t the status change? As a result, I have to probe for a non-nil deleted_at (which is super annoying). Am I missing something?


(Epipheus) #2

So wait… I have to empty the trash for it to go away? Fine, but the status should still change. Status still should not be “published” if it’s in the trash in my opinion.


(Aaron Russell) #3

The published state and deleted state are two different things. When you delete a node, all of it’s descendant children have their deleted_at timestamp touched, but their published_at timestamp remains unchanged.

This allows you to restore deleted nodes and retain the original published date.

Deleted nodes shouldn’t ever appear on the front end, but if you’re doing any of your own queries in your ApplicationController or in your veiws, then make sure you’re always using the Node.published scope as this ensures the node isn’t trashed.