audited icon indicating copy to clipboard operation
audited copied to clipboard

Audited 4.5.0 creating an audit where attribute did not change

Open tilo opened this issue 7 years ago • 2 comments

We are using audited 4.5.0 with Rails 5.0.6 and Ruby 2.3.5

we get some Audit table entries, recording an attribute change when the value of the attribute did not change...

        :action => "update",
        :audited_changes => "---\nmanager_email:\n- [email protected]\n- [email protected]\n",

Has anyone seen this kind of behavior, and are there any suggestions how to avoid this?

tilo avatar Jan 10 '18 00:01 tilo

Hi @tilo, Is it possible that your model marks the attribute as changed or dirty even when it is not changed? Also, a new version of audited gem, 4.6.0, was released a few days ago, and it includes some improvements to change detection. Is the issue still present in that version?

tbrisker avatar Jan 14 '18 14:01 tbrisker

I tried updating from 4.5.0 to 4.9.0 for a similar problem (audited reading #changed_attributes, which produces a false positive if same-value assignment (instance.field = instance.field) is performed), and the problem went away.

Epigene avatar Oct 26 '20 12:10 Epigene