public
Description: acts_as_audited is an ActiveRecord extension that logs all changes to your models in an audits table.
Homepage: http://wiki.github.com/collectiveidea/acts_as_audited
Clone URL: git://github.com/collectiveidea/acts_as_audited.git
Click here to lend your support to: acts_as_audited and make a donation at www.pledgie.com !
name age message
file .gitignore Mon Sep 28 17:48:35 -0700 2009 Gemified [brandon]
file CHANGELOG Tue Jan 27 19:23:47 -0800 2009 Store all attributes on create and destroy, and... [brandon]
file LICENSE Mon Feb 23 05:58:59 -0800 2009 Added license [brandon]
file README Sun Nov 01 09:18:06 -0800 2009 Added link to the mailing list [brandon]
file Rakefile Mon Sep 28 17:48:35 -0700 2009 Gemified [brandon]
file VERSION Sun Nov 01 09:19:41 -0800 2009 Version bump to 1.1.0 [brandon]
file acts_as_audited.gemspec Sun Nov 01 09:19:41 -0800 2009 Version bump to 1.1.0 [brandon]
directory generators/ Sun Jun 17 11:02:18 -0700 2007 added revisioning support [brandon]
file init.rb Mon Sep 28 17:48:35 -0700 2009 Gemified [brandon]
directory lib/ Sun Nov 01 09:18:06 -0800 2009 Remove unnecessary aliasing of callbacks that i... [brandon]
directory rails/ Sun Nov 01 09:18:00 -0800 2009 Deprecated #audit in the controller. User audit... [brandon]
directory test/ Sun Nov 01 09:18:06 -0800 2009 Remove unnecessary aliasing of callbacks that i... [brandon]
README
= acts_as_audited

acts_as_audited is an ActiveRecord extension that logs all changes to your models in an audits table.

The purpose of this fork is to store both the previous values and the changed value, making each audit record 
selfcontained.

== Installation

* acts_as_audited can be installed as a gem:
    
    # config/environment.rb
    config.gem 'acts_as_audited', :lib => false, :source => 'http://gemcutter.org'

  or a plugin:

    script/plugin install git://github.com/collectiveidea/acts_as_audited.git

* Generate the migration
    script/generate audited_migration add_audits_table
    rake db:migrate

== Usage

Declare <tt>acts_as_audited</tt> on your models:

    class User < ActiveRecord::Base
      acts_as_audited :except => [:password, :mistress]
    end
    
Within a web request, will automatically record the user that made the change if your controller has a 
<tt>current_user</tt> method.

To record a user in the audits outside of a web request, you can use <tt>as_user</tt>:

    Audit.as_user(user) do
      # Perform changes on audited models
    end

== Caveats

If your model declares +attr_accessible+ after +acts_as_audited+, you need to set +:protect+ to false. acts_as_audited 
uses +attr_protected+ internally to prevent malicious users from unassociating your audits, and Rails does not allow 
both +attr_protected+ and +attr_accessible+. It will default to false if +attr_accessible+ is called before 
+acts_as_audited+, but needs to be explicitly set if it is called after.

  class User < ActiveRecord::Base
    acts_as_audited :protect => false
    attr_accessible :name
  end

== Compatability

acts_as_audited works with Rails 2.1 or later.

== Getting Help

Join the mailing list for getting help or offering suggestions:
  http://groups.google.com/group/acts_as_audited

== Contributing

Contributions are always welcome. Checkout the latest code on GitHub:
  http://github.com/collectiveidea/acts_as_audited

Please include tests with your patches. There are a few gems required to run the tests:
  $ gem install multi_rails
  $ gem install thoughtbot-shoulda jnunemaker-matchy --source http://gems.github.com

Make sure the tests pass against all versions of Rails since 2.1:

  $ rake test:multi_rails:all

Please report bugs or feature suggestions on GitHub:
  http://github.com/collectiveidea/acts_as_audited/issues