Skip to content
A gem that creates audit records around events you define
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.document
.gitignore
Gemfile
Gemfile.lock
LICENSE.txt
README.rdoc
Rakefile
VERSION
audit_record.gemspec

README.rdoc

Audit Record

A simple gem built for Rails 3+ which creates an audit record when users trigger events you flag. The events you can trigger audit on are:

  1. When attributes changing in a model

  2. When specific methods of a class are executed

  3. When you trigger an AuditRecord through code as part of a manual audit process

Installation

In Gemfile:

gem “audit_record”

In your application root, run:

$ bundle install

Generate the migration:

After running one of the generators: $ rake db:migrate

Usage

class User < ActiveRecord::Base
  audit :attributes => [:name, :is_admin], :methods => [:unlock_account!, :destroy]
end

Contributing to audit

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.

  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Special Thanks

Much of Audit was inspired by acts_as_audited, which is a fine gem in its own right. github.com/collectiveidea/acts_as_audited

However, my goal was to strip features down as much as possible and lock audits (where possible) to the model methods and attributes.

Copyright

Copyright © 2012 Mark Daggett. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.