A Rails plugin for soft-deleting ActiveRecord records by setting a deleted_at timestamp instead of permanent deletion.
PermanentRecords is a Ruby on Rails plugin that implements soft deletion for ActiveRecord models. It prevents permanent data loss by setting a `deleted_at` timestamp instead of deleting records from the database, enabling easy recovery and data archiving.
Rails developers who need to preserve data integrity and allow recovery of deleted records without modifying their existing application code.
It automates soft deletion with zero code changes, supports dependent record handling, and integrates seamlessly with ActiveRecord's lifecycle, making it a reliable alternative to manual soft-delete implementations.
Rails Plugin - soft-delete your ActiveRecord records. It's like an explicit version of ActsAsParanoid
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically intercepts ActiveRecord's `destroy` method to set `deleted_at` without requiring changes to existing application logic, as highlighted in the README's 'Is Everything Automated?' section.
Handles cascading soft deletion and revival for associations defined with `:dependent => :destroy`, ensuring data integrity when reviving parent records, as demonstrated in the README's revival examples.
Provides both soft deletion via standard `destroy` and permanent deletion with `destroy(:force)`, offering control over data retention without sacrificing compatibility.
Includes `deleted` and `not_deleted` scopes for easy filtering, allowing precise retrieval of records based on deletion status directly from the model.
Normal `find` queries include deleted records by default, requiring manual use of the `not_deleted` scope to avoid accidental data leakage—a subtle bug risk noted in the README.
If you add a default scope to exclude deleted records, you must manually define a `deleted` scope with `unscoped`, adding boilerplate code and complexity as admitted in the README.
Last updated in 2015 with minimal recent activity, raising questions about compatibility with newer Rails versions and lack of modern features like Rails 6+ callbacks or transaction safety.