auditable icon indicating copy to clipboard operation
auditable copied to clipboard

Allow audits to be destroyed when parent model is destroyed

Open mguymon opened this issue 12 years ago • 3 comments

mguymon avatar Oct 08 '13 19:10 mguymon

Is there any suggested workaround for this at the time?

danielpuglisi avatar Jul 30 '14 08:07 danielpuglisi

An after_destroy on the parent to clean up the audits.

The fix maybe be as simple adding the :dependent => :delete to auditable in https://github.com/harleyttd/auditable/blob/master/lib/auditable/base.rb

mguymon avatar Jul 30 '14 18:07 mguymon

Okay, I just took another look at the code an its actually already possible:

# Example
audit :title, version: true, dependent: :destroy

danielpuglisi avatar Sep 18 '14 13:09 danielpuglisi