Paranoia is a re-implementation of acts_as_paranoid for Rails 3/4/5, using much, much, much less code.
When your app is using Paranoia, calling destroy on an ActiveRecord object doesn't actually destroy the database record, but just hides it. Paranoia does this by setting a deleted_at field to the current time when you destroy a record, and hides it by scoping all queries on your model to only include records which do not have a deleted_at field.
If you wish to actually destroy an object you may call really_destroy!. WARNING: This will also really destroy all dependent: :destroy records, so please aim this method away from face when using.
If a record has has_many associations defined AND those associations have dependent: :destroy set on them, then they will also be soft-deleted if acts_as_paranoid is set, otherwise the normal destroy will be called.
Paranoia alternatives and related gems
Based on the "Auditing" category
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of Paranoia or a related project?
Paranoia RecommendationsThere are no recommendations yet. Be the first to promote Paranoia!
Have you used Paranoia? Share your experience. Write a short recommendation and Paranoia, you and your project will be promoted on Awesome Ruby.
Recently added Paranoia resources
When your app is using Paranoia, calling destroy on an ActiveRecord object doesn't actually destroy the database record, but just hides it.Tutorial Added by kobaltz // www.driftingruby.com // almost 3 years ago