No release in over a year
Administrate's plugin to show PaperTrail versions via new field type
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.4

Runtime

>= 0.2.2
>= 2.7.2
>= 5.0
 Project Readme

AdministrateFieldPaperTrail

Gem CI

An Administrate plugin to show record change histories from PaperTrail.

Requirements

  • Ruby on Rails version >= 5.0
  • Administrate version >= 0.2.2
  • PaperTrail version >= 2.7.2

Installation

Make sure you already setup PaperTrail properly in your project. Add administrate-field-paper_trail to your Gemfile:

gem 'administrate-field-paper_trail'

And then execute:

$ bundle install

Usage

Add to your UserDashboard:

ATTRIBUTE_TYPES = {
  changeset: Field::PaperTrail.with_options(excluded_attributes: %w[created_at updated_at]),
}

The excluded_attributes option takes an array of string of the attributes you want to exclude from the result. Default excluded attributes are: id, created_at, and updated_at.

Then show the field in your show page like so:

SHOW_PAGE_ATTRIBUTES = %i[
  changeset
]

Currently, only support to show changes in the show page. Contribution will be appreciated.

To Do

  • Show record changes information in the show page
  • Show count of changes of each records in the index page
  • Add i18n support for the result message
  • Add i18n support for date/time value

Contributing

  1. Contribution are welcome (codes, suggestions, and bugs)
  2. Please test your code: bundle exec rspec
  3. Please document your code
  4. Bug reports and pull requests are welcome on GitHub at https://github.com/IrvanFza/administrate-field-paper_trail

License

MIT License


Based on the Administrate::Field::Image template