audited
audited copied to clipboard
A way to audit associations
Problem
As a developer I need to audit model associations changes.
Example
A Team has many Members. When adding/removing members through a form submission capture memberships changes in the Team audit similar to how Team name would be audited.
Our Workaround
we've developed small module to solve this for us, it works like this:
- override
membership_associations= - capture
membership_attributesbefore and after change - add the
membershipsattribute to theaudited_changeshash
This works for us due to associations being small so captured hash is fairly small.
Question
- Are there any plans Audited have this functionality?
- If so would PR adding above functionality be a good idea?
Thank you!
@mhratson 3 years forward I'm dealing with the same issue. Would you mind sharing some code snippets if you ever see this comment? ;)