An ActiveRecord plugin for atomic archiving and unarchiving of object trees with dependent associations.
ActsAsArchival is a Ruby gem and ActiveRecord plugin that provides atomic archiving and unarchiving capabilities for object trees in Rails applications. It solves the problem of partial deletion or restoration when soft-deleting records with dependent associations by ensuring all related records are archived or unarchived together in a single transaction.
Rails developers who need reliable soft-deletion with dependent associations, particularly those working on applications where data integrity and atomic operations are critical.
Developers choose ActsAsArchival over other soft-deletion gems because it guarantees atomicity across entire object trees, prevents partial data loss, and works seamlessly with ActiveRecord's dependent-destroy associations without overriding standard destroy/delete methods.
An ActiveRecord plugin for atomic archiving and unarchiving of object trees. Inspired by ActsAsParanoid and PermanentRecord
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Archives and unarchives entire object trees within a single database transaction, preventing partial data loss and ensuring data consistency across complex hierarchies.
Automatically archives dependent-destroy associations when a parent is archived, maintaining relational integrity without requiring manual intervention for each record.
Provides built-in `archived` and `unarchived` scopes, along with utility methods like `archival?`, simplifying data retrieval and management in Rails applications.
Supports before and after callbacks for archive and unarchive operations, allowing developers to integrate custom business logic, such as notifications or cleanup tasks.
Only supports dependent-destroy associations by default, as noted in the README's caveats, requiring workarounds or code changes for other association types like dependent: :nullify.
Requires adding `archive_number` and `archived_at` columns to every model that uses it, which can be intrusive and time-consuming for large, existing codebases with many tables.
The project is mature with infrequent updates, which might delay compatibility with new Rails versions or bug fixes, though the README claims it's stable and only updated for major ActiveRecord releases.