Papertrail - rafaellima/rails_admin GitHub Wiki
- First install PaperTrail
Note: you should use the --with-changes option when creating the version table
to ensure that history messages are recorded in a object_changes column.
$ bundle exec rails generate paper_trail:install --with-changes
Connecting to database specified by database.yml`
create db/migrate/20131113103143_create_versions.rb
create db/migrate/20131113103144_add_object_changes_column_to_versions.rb
- add the
has_paper_trailstatements to the tracked models - add this to your
rails_admin.rbinitializer:
config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
config.audit_with :paper_trail, 'User', 'Version' # PaperTrail < 3.0.0
User should be your 'whodunnit' model.