Sha256: 6c22d5b3493ccd4cdb23330a94b5b85d35ea76c290b43d5fb65aedbee58f1f4d

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

ActiveRecord history

## Installation

```
gem install record_history
rails g record_history:install
```

## Usage

    # activate history logging for model
    class Item < ActiveRecord::Base
      has_record_history
    end

    # activate history logging for model (only for "name" field)
    class Item < ActiveRecord::Base
      has_record_history :only => [:name]
    end
  
    # activate history logging for model (except 'name' field)
    class Item < ActiveRecord::Base
      has_record_history :ignore => [:name]
    end
  
    # activate history logging for model (on update)
    class Item < ActiveRecord::Base
      has_record_history :on => [:update]
    end
  
    # get history for object
    item = Item.first
    history = item.first.record_history
    history.first.old_value
    hostory.first.new_value
  
  
    # declare that User is author for some record_history items
    class User < ActiveRecord::Base
      is_record_history_author
    end
  
    # get record_history items created by user
    User.first.written_history
  

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
record_history-0.9.2 README.md
record_history-0.9.1 README.md