Ash FrameworkAF
Ash Framework9mo ago
5 replies
AngyL75

Ash Paper Trail, destroy action

I would like to know how to remove the versions of an object that I deleted.
I have used a destroy action on a parent object. this parent object has a version system in place with the following configuration:

paper_trail do
    primary_key_type :uuid
    only_when_changed? true
    change_tracking_mode :changes_only
    store_action_name? true
    store_action_inputs? true
    ignore_attributes [:inserted_at, :updated_at]
    reference_source? false
    # for multitenancy
    attributes_as_attributes [:organization_id]
    belongs_to_actor :actor, CauseBeacon.Accounts.User, public?: false
 end


I would like to be able to delete all the related versions in the "paper-trail" table, related to the row/object that I want to destroy.
when using reference_source? true, I fail to destroy my row. now it destroy my row, but I have new row in my version, every time I am destroying an object (since I do not have the
ignore_actions [:destroy]
)

Regards,
Angy
Was this page helpful?