# Paranoia

> acts_as_paranoid for Rails 5, 6 and 7

Source: https://talira.ai/catalog/paranoia-4nvnvejt
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / databases / soft delete](https://talira.ai/categories/libraries/databases/soft-delete), [languages / ruby / rails](https://talira.ai/categories/languages/ruby/rails)
- Licence: MIT-Modern-Variant[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Self-hostable: yes[^1]
- API: yes[^1]
- Backed by: [Ruby Sherpas](https://talira.ai/orgs/ruby-sherpas.md)

Paranoia soft-deletes Active Record models: with `acts_as_paranoid`, `destroy` sets a `deleted_at` timestamp instead of removing the row, and a default scope hides deleted records from every query. `with_deleted` and `only_deleted` find them, `restore` brings them back (with their dependent records, optionally within a recovery window), `really_destroy!` removes them for good, and `dependent: :destroy` associations are soft-deleted with their parent. It re-implements acts_as_paranoid in much less code. Its README says it isn't recommended for new projects because it overrides Active Record's `delete` and `destroy`, points to discard instead, and takes bug fixes and new Rails versions but no new features.

## Links

- GitHub: https://github.com/rubysherpas/paranoia

## Problems it solves

- deleted records should be hidden in my Rails app, not removed from the database
- let users undo a delete and get the record back
- keep deleted orders for reporting while the app behaves as if they're gone
- restore a record together with the child records that were deleted with it
- list only the records that were deleted, or include them in one query
- permanently purge a hidden record when it really has to go
- add a deleted_at column and have every query skip those rows automatically
- stop a deleted record from being attached to another record
- recover rows someone deleted by mistake without restoring a database backup

## Features

- destroy sets deleted_at; a default scope hides deleted rows
- with_deleted, without_deleted and only_deleted scopes
- restore, recursive restore and a recovery window
- really_destroy! for permanent deletes
- soft-deletes dependent: :destroy associations
- custom column name and an option to skip the default scope
- after_restore_commit callback
- association_not_soft_destroyed validator

## Limitations

- Not recommended for new projects by its maintainers: it overrides Active Record's delete and destroy, and they point to discard[^1]
- Doesn't take new features: it gets bug fixes and support for new Rails versions only[^1]

## Capabilities

- Has an API: plan not known

## Trust

Overall: 0.32 out of 1.
Signals: backing 0.30, extensibility 0.20.

- backed by Ruby Sherpas

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [Discard](https://talira.ai/catalog/discard-3rzychgj.md): Soft deletes for ActiveRecord done right

## Sources

[^1]: https://github.com/rubysherpas/paranoia (checked 20 Nov 2026)
[^2]: https://github.com/rubysherpas/paranoia/blob/core/LICENSE (checked 20 Nov 2026)
