Sha256: 0b56c748de318dda8b78bb35a36e90757a0b974097558014ba368c9a7cf7aaa6

Contents?: true

Size: 1.62 KB

Versions: 2

Compression:

Stored size: 1.62 KB

Contents

# ModelLog

User operation data saves log files and records user information.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'model_log', :git => 'git@bitbucket.org:scige/model_log.git'
```

And then execute:

    $ bundle install

## Usage

Simply call `model_log` on your models:

```ruby
class User < ActiveRecord::Base
  model_log
end
```

## Log Path

The log is saved in the `log/` section of your rails app.

The development environment file is called `model_log_development.log`.

The product environment file is called `model_log_product.log`.

## Current User Tracking

If you're using ModelLog in a Rails application, all audited changes made within a request will automatically be attributed to the current user. By default, ModelLog uses the `current_passport` method in your controller.

The username field default to `username`.

To use a method other than `current_passport` and a field other than `username`, put the following in an initializer:

```ruby
# config/initializers/model_log.rb

ModelLog.current_user_method = :current_user
ModelLog.user_name_field = :name
```

## Other Settings

If you have multiple platforms, and the tag data changes belong to that platform, put the following in an initializer:

```ruby
# config/initializers/model_log.rb

ModelLog.platform = :CPM
```

## Run Error
If you run a rails app hint `The git source git@bitbucket.org:scige/model_log.git is not yet checked out. Please run “bundle install” before trying to start your application`, Try to run

    $ bundle install --deployment



## Gem Update

If you want to update the gem, run:

    $ bundle update model_log

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
model_log-1.0.2 README.md
model_log-1.0.1 README.md