How does Archival Work?
View SourceWe make modifications to the resource to enable soft deletes. Here's a breakdown of what the extension does:
Resource Modifications
- Adds a private
archived_atutc_datetime_usecattribute. - Adds a preparation that filters each action for
is_nil(archived_at)(except for excluded actions, or if you havebase_filter?set totrue). - Marks all destroy actions as
soft?, turning them into updates (except for excluded actions) - Adds a change to all destroy actions that sets
archived_atto the current timestamp - Adds a change that will iteratively load and destroy anything configured in
AshArchival.Resource.archive.archive_related