// the find
collectiveidea/audited
Audited (formerly acts_as_audited) is an ORM extension that logs all changes to your Rails models.
Audited is an ActiveRecord extension that writes a row to an audits table on every create, update, and destroy of a model, recording the changed attributes, the acting user, and an optional comment. It suits Rails teams that need a change history for compliance or support work and are willing to keep the audit table in their own database.
- Revisions are rebuilt from the stored attribute diffs, so user.revision_at(date) returns the record as it was without a separate snapshot table.
- associated_with plus own_and_associated_audits pulls every audit touching a company, including changes to its users, in one query instead of joining across models.
- Attributes encrypted with Rails' encrypts are logged as [FILTERED] automatically, so passwords and tokens do not end up in plain text in the audit log.
- The jsonb option on the install generator stores audited_changes as native Postgres JSON, which keeps the audit table queryable without parsing YAML.
- Auditing runs in model callbacks, so update_all, delete, insert_all, and raw SQL write no audit rows at all. Anything outside the model layer is invisible, and nothing in the gem warns you about it.
- Retention is per record: max_audits trims history for each model instance, but there is no global policy for the audits table, which grows with every write unless you add your own pruning job.
- The default YAML storage for audited_changes is hard to query and awkward to change later. Pick jsonb or json at install time, because converting an existing table means a data migration.
- Current user tracking depends on a controller method and a thread-local store. Background jobs and console scripts need as_user wrapped around them by hand, and the last push to the repo was November 2025, so check the open issues before adopting it on a recent Rails release.