talira

Audited (formerly acts_as_audited) is an ORM extension that logs all changes to your Rails models.

open sourceMITself-hostablefree

Audited logs each create, update, touch and destroy of an Active Record model to an audits table, with the changed attributes, the action, the user who made it (from current_user in a request, or as_user elsewhere) and an optional comment. You can limit it to some columns or actions, add conditions, require comments, cap how many audits each record keeps, and file a child's audits under its parent with associated_with. A record can be rebuilt as it was at an earlier revision or date, encrypted attributes are logged as [FILTERED], and on PostgreSQL the changes can be stored as jsonb. Collective Idea maintains it; it was called acts_as_audited before.

Problems it solves

  • see who changed a record in my Rails app and what the old value was
  • keep a history of every edit to customer records for a compliance review
  • record which admin made a change, even from the console or a script
  • show what a record looked like on a date last month
  • an activity log of changes to every user in one company
  • make people give a reason when they edit sensitive data
  • track changes to some columns but never keep passwords in the history
  • our change history keeps growing; keep only the last few versions of each record
  • log deletes too, so we know who removed a record
  • an audit trail of model changes without writing database triggers

Features

  • audits for create, update, touch and destroy
  • current user from the controller, or as_user outside requests
  • only and except columns, on actions, and if or unless conditions
  • audit comments, optionally required
  • max_audits per model or globally
  • associated audits under a parent record
  • revisions and revision_at to rebuild earlier versions
  • encrypted attributes logged as [FILTERED]
  • YAML, json or jsonb storage of changes
  • custom Audit model

Limitations

  • Doesn't support ORMs other than Active Record: MongoMapper support stayed on the 4.2-stable branch1

Capabilities

Has an APIplan not known

Alternatives

The same job

These do what Audited does.

  1. PaperTrail Track changes to your models, for auditing or versioning

Compare Audited with the top 3