A Rails plugin that adds soft delete functionality to ActiveRecord models, hiding records instead of permanently deleting them.
ActsAsParanoid is a Ruby on Rails plugin that adds soft delete functionality to ActiveRecord models. It allows records to be hidden from queries instead of permanently deleted, enabling data recovery and audit trails. The plugin is commonly used to prevent accidental data loss in applications where retaining historical data is important.
Rails developers building applications that require data retention, undo functionality, or audit trails, such as content management systems, e-commerce platforms, or administrative dashboards.
Developers choose ActsAsParanoid because it provides a simple, drop-in solution for soft deletion without modifying core ActiveRecord behavior. It offers flexibility with configurable columns, scopes for querying deleted data, and built-in recovery mechanisms, saving time compared to implementing custom soft delete logic.
ActiveRecord plugin allowing you to hide and restore records without actually deleting them.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Adds soft delete with a single `acts_as_paranoid` call, seamlessly extending ActiveRecord without overriding core methods like `destroy`.
Supports custom column names and types (boolean, time, string) for deletion status, as shown in the options for `column` and `column_type`.
Provides a `recover` method that recursively restores dependent associations with configurable windows, detailed in the recovery section.
Includes `validates_uniqueness_of_without_deleted` to handle uniqueness only among non-deleted records, addressing a common soft-delete pitfall.
A known issue causes SystemStackError when used with ActiveStorage on the same model, limiting its use in modern Rails apps with file uploads.
Only supports Rails 6.1+ and Ruby 3.1+, forcing upgrades for older projects and creating maintenance hurdles for legacy codebases.
Cannot use custom scopes named `with_deleted` or `only_deleted`, which can clash with business logic and require workarounds.
Does not allow creating or updating models directly in a deleted state, restricting advanced workflows like bulk archival setups.