All Projects → jemcode → rails_admin_history_rollback

jemcode / rails_admin_history_rollback

Licence: MIT license
History rollback for rails_admin with paper_trail

Programming Languages

Haml
164 projects
ruby
36898 projects - #4 most used programming language
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to rails admin history rollback

rollinbox
Ruby On Rails sandbox with rails-admin
Stars: ✭ 33 (-19.51%)
Mutual labels:  rails-admin
guias-de-rails-espanol
Guías de Rails en Español (Rails 5) Estas son las guías de Rails 5 en Español (Guías Completas, con todos los Capítulos). Estas guías están diseñadas para que tengas una productividad inmediata con Rails, y para ayudarte a entender como encajan las piezas en Rails.
Stars: ✭ 42 (+2.44%)
Mutual labels:  rails-admin
terraform-provider-papertrail
Papertrail support for Terraform
Stars: ✭ 14 (-65.85%)
Mutual labels:  papertrail
papertrail-timber
Pluggable timber tree for Papertrail logging
Stars: ✭ 20 (-51.22%)
Mutual labels:  papertrail
sequelize-paper-trail
Sequelize plugin for tracking revision history of model instances.
Stars: ✭ 90 (+119.51%)
Mutual labels:  papertrail
heroku-postico
Heroku Postgres connection tool for Postico
Stars: ✭ 37 (-9.76%)
Mutual labels:  jemcode

Rails Admin History Rollback

Gem Version Code Climate

RailsAdmin extension for enabling users to easily visualise and revert their history audit created by the PaperTrail gem.

Installation

To enable rails_admin_history_rollback, add the following to your Gemfile ensuring it is added after rails_admin:

gem 'rails_admin'
gem 'rails_admin_history_rollback'

It should go without saying that this plugin also requires the paper_trail gem.

E.g. gem 'paper_trail'

Configuration

Simply enable paper_trail on your model --with-changes --with-associations and set up as usual by following the paper_trail instructions.

rails generate paper_trail:install --with-changes --with-associations

In the rails_admin.rb initializer, uncomment the following lines to enable auditing:

history_index
history_show

Notes

You may also need to require "paper_trail" in application.rb

As pointed out in issue #8, paper_trail master branch and release v5.0.0 (when available) causes session issues. Login is reset by devise; paper_trail tries to access to the current_user variable before devise (airblade/paper_trail#556).

The fix is to manually add set_paper_trail_whodunnit before_action as advised here: (https://github.com/airblade/paper_trail#finding-out-who-was-responsible-for-a-change)

# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
  [...]
  before_action :set_paper_trail_whodunnit
  [...]
end

Screenshots

History view

Modal view

About Jemcode

Jemcode

This repository is maintained and funded by Jemcode Limited. We are available for hire.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].