Paranoia is a re-implementation of [acts\_as\_paranoid](http://github.com/technoweenie/acts_as_paranoid) for Rails 3, using much, much, much less code.
Paranoia is a re-implementation of [acts\_as\_paranoid](http://github.com/technoweenie/acts_as_paranoid) for Rails 3, using much, much, much less code.
You would use either plugin / gem if you wished that when you called `destroy` on an Active Record object that it didn't actually destroy it, but just "hid" the record. 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.
You would use either plugin / gem if you wished that when you called `destroy` on an Active Record object that it didn't actually destroy it, but just *hide* the record. 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!`.
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.
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.
## Installation & Usage
## Installation & Usage
For Rails 3, please use version 1 of Paranoia:
For Rails 3, please use version 1 of Paranoia:
```ruby
```ruby
gem'paranoia','~> 1.0'
gem"paranoia","~> 1.0"
```
```
For Rails 4, please use version 2 of Paranoia:
For Rails 4, please use version 2 of Paranoia:
```ruby
```ruby
gem'paranoia','~> 2.0'
gem"paranoia","~> 2.0"
```
```
Of course you can install this from GitHub as well:
Of course you can install this from GitHub as well: