
Log mutations for n:n relations
I've noticed that when i activate logging for a model that has a "has and belongs to many" relation with another model (n:n), the changes in this relation are not logged.
(muations are logged for 1:n relations, which is good).
I think that logging should also cover these changes in relations. Otherwise logging cannot be used in audits.
Does anyone know of a workaround (or maybe i'm overlooking something) for this issue? My use-case:
When an auditor is linked to an audit, an email should be sent to this auditor. I want to create an action for this. But when an audit is linked to auditor A (which has received an email) and later we also link auditor B, only the newly connected auditor (B) should receive an Email. So i need to compare before and after values for the connected auditors, and send emails based on the newly added auditors.
ps this is a back-end action, and assigning auditors is also done in the backend.
I've noticed that when i activate logging for a model that has a "has and belongs to many" relation with another model (n:n), the changes in this relation are not logged.
(muations are logged for 1:n relations, which is good).
I think that logging should also cover these changes in relations. Otherwise logging cannot be used in audits.
Does anyone know of a workaround (or maybe i'm overlooking something) for this issue? My use-case:
When an auditor is linked to an audit, an email should be sent to this auditor. I want to create an action for this. But when an audit is linked to auditor A (which has received an email) and later we also link auditor B, only the newly connected auditor (B) should receive an Email. So i need to compare before and after values for the connected auditors, and send emails based on the newly added auditors.
ps this is a back-end action, and assigning auditors is also done in the backend.
Login to reply