Automatic log every DataMapper model
Add dm-crud to Gemfile:
# Gemfile
gem 'dm-historylog', :git => 'http://github.com/avillagran/dm-historylog'
Run:
bundle install
### Installation
Run the install generator:
rails g historylog:install
Create historylog
table:
rake db:autoupgrade
Add include DataMapper::Historylog
on your models
include DataMapper::Historylog
class Example
include DataMapper::Resource
include DataMapper::Timestamp
include DataMapper::Historylog
property :id, Serial
property :name, String
timestamps :at
property :deleted_at, ParanoidDateTime
end
Every action with Example model (save
, create
, update
and destroy
) will generate a new record in historylog
table.
- Tests
- Documentation!