views:

912

answers:

3

Hello,

I'm looking for a rails plugin/gem which brings the functionality of marking an ActiveRecord-Model deleted, instead of deleteing it.

Does anybody know, what gems or plugins are up to date? (AAP is out-dated and is_paranoid doesn't appear to be used by the community).

Do you know alternatives?

+1  A: 

Hi,

How about you just have a valid:boolean column/attribute and set it to false when you wish to soft-delete the model? Or am I missing something?

Barry Gallagher
I would like to do that automatically :)
Lichtamberg
A: 

is_paranoid doesn't appear to be used by the community

http://chadfowler.com/2009/7/8/how-ruby-mixins-work-with-inheritance - Just a blog post the other day talking about it. Seems like it solved Chad's problem just fine (as well as lead him to write a post about inheritance and mixins).

rnicholson
Yeah - I read it too. Do you know alternatives through?
Lichtamberg
No sorry. Is there a reason that is_paranoid is unusable for your needs?
rnicholson
No, but didn't found much websites about it... Therefore i thought its not very famouse... however, thank you
Lichtamberg
+3  A: 

It seems even the authors of both acts_as_paranoid and is_paranoid aren't using their respective plugins/gems any more. Both are using named scopes.

Yeah, it's not automagic or anything, but sometimes being explicit about your intentions is a good thing.

Trevor Oke
This. (I'm the author of is_paranoid.)
semanticart