collectiveidea / audited

Audited (formerly acts_as_audited) is an ORM extension that logs all changes to your Rails models.
MIT License
3.34k stars 645 forks source link

Gem is not saving auditable_id, auditable_type for User model #710

Open augustosamame opened 1 month ago

augustosamame commented 1 month ago

Gem works fine for all models, except for User model. I have added audited to User model and others.

For User model, upon doing any edits through my custom admin to user records, both the auditable_id and auditable_type are nil. The user_id for the audit record corresponds to the User record being modified, not the current_user.

I do have a standard current_user method through Devise that returns the user object. All other audited models work fine.

This is vanilla audited installation. The only thing extra I did was create an empty Audit model in order to use console to see Audit records.

Audited version: 5.6.0 Rails version: 7.1.2 Devise version: 4.9