How does Archival Work?
Table of Contents
We make modifications to the resource to enable soft deletes. Here’s a breakdown of what the extension does:
Resource Modifications
-
Adds a private
archived_at
utc_datetime_usec
attribute. -
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_at
to the current timestamp -
Adds a change that will iteratively load and destroy anything configured in
d:AshArchival.Resource.archive|archive_related