Soft deletion

So i was wondering about the best way to approach building an
application with in-place soft deletion.

The requirements so far are:

  • rows are never deleted just a flag set as deleted = true
  • unique validation does not include deleted rows
  • find methods should not return deleted rows
  • find_deleted methods should return deleted rows (so pretty much the
    same as an unmodified find)
  • when using find(:include => :children), deleted children should not be
    included in the eager fetch, unless :include_deleted is used

The goal is to have the soft deletion feature behave transparently to
rails.

What is the best way to go about this? I’m fairly new to ruby and rails
(I’ve read the Pragmatic Rails book, the pickaxe book and skimmed the
two recipe books), and I have a vague idea that we should modify the
find method, but we would also need to change the :include behaviour,
but I dont really know where to start.

Is this going to become a giant ugly mega hack?:frowning:

Isn’t there acts_as_paranoid that does this?