Sha256: f5bcf4bd9a644e7d01eeaf4f1873fcaacab219075ba3d1377003c777fa3c5d6a

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

# LogBook

Storing an events log book.

## Installation

Add this line to your application's Gemfile:

    gem "log_book"

### Create the table

    rails generate guinea_pig:migration
    rake db:migrate

### ActsOnTaggableOn dependency

    rails generate acts_as_taggable_on:migration
    rake db:migrate

## Usage

In any point:

    LogBook.event(<who executes the action>, <over which object>, <text>, <list of tags>)

For example:

    LogBook.event(current_user, item, "Item canceled", [:purchase, :canceled])

## ActiveRecord integration

    class MyModel < ActiveRecord::Base
      log_book_log_book
    end

    MyModel.create!   # => LogBook created
    my_model.save!    # => LogBook created
    my_model.destroy! # => LogBook created

If you want to include _who executes the action_ use the special attribute `log_book_historian`:

    my_model.log_book_historian = current_user
    my_model.save!

## Sate of the art

Beta version but already used in production environments

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
log_book-0.0.1 README.md