Wiki

Clone wiki

audits / Home

Welcome to the Audits Gem wiki

Install instructions

Simply include:

gem audits

In your Gemfile and bundle install, or:

gem install audits

From the command line. After the gem has been included make sure you run the installer:

rails generate audits_install [user_class_name -> Default is 'user']

This will generate a migration and maybe some other files needed for the gem to work properly. Make sure you execute the migrations.

rake db:migrate

Usage

#!ruby

class Product < ActiveRecord::Base
  audits :name, :description
end

This assumes that there is a Product model that has at least 2 columns (name, description). Whenever an existing product is changed and saved, a record will be saved in changes for each column that changed specifying old and new value among other details.

Updated