Module: PaperTrailHistory

Defined in:
lib/paper_trail_history.rb,
lib/paper_trail_history/engine.rb,
lib/paper_trail_history/version.rb,
lib/paper_trail_history/configuration.rb,
app/jobs/paper_trail_history/application_job.rb,
app/models/paper_trail_history/trackable_model.rb,
app/models/paper_trail_history/version_service.rb,
app/models/paper_trail_history/version_decorator.rb,
app/models/paper_trail_history/application_record.rb,
app/helpers/paper_trail_history/application_helper.rb,
app/mailers/paper_trail_history/application_mailer.rb,
app/controllers/paper_trail_history/models_controller.rb,
app/controllers/paper_trail_history/records_controller.rb,
app/controllers/paper_trail_history/versions_controller.rb,
app/controllers/paper_trail_history/application_controller.rb

Overview

PaperTrailHistory is a Ruby on Rails engine that provides a history of changes made to models using the PaperTrail gem. It allows you to track changes, view previous versions of records, and restore them if needed.

This engine integrates with the PaperTrail gem to provide a user-friendly interface for viewing and managing the history of changes made to your models. It includes routes, controllers, and views to display the history of changes in a structured manner.

The engine shows the full audit trail and can overwrite records. It has no authentication of its own. Give it the access rules of the host application with PaperTrailHistory.configure.

Defined Under Namespace

Modules: ApplicationHelper Classes: ApplicationController, ApplicationJob, ApplicationMailer, ApplicationRecord, Configuration, ConfigurationError, Engine, Error, ModelsController, RecordsController, TrackableModel, VersionDecorator, VersionService, VersionsController

Constant Summary collapse

VERSION =

The version of this gem.

'0.3.0'

Class Method Summary collapse

Class Method Details

.configPaperTrailHistory::Configuration

Gives the configuration of the engine.



31
32
33
# File 'lib/paper_trail_history.rb', line 31

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ PaperTrailHistory::Configuration

Configures the engine.

Examples:

PaperTrailHistory.configure do |config|
  config.authenticate_with = -> { authenticate_user! }
end

Yield Parameters:

Returns:



44
45
46
47
# File 'lib/paper_trail_history.rb', line 44

def configure
  yield config
  config
end

.reset_config!PaperTrailHistory::Configuration

Gives back the default configuration.

This method exists for the test suite. Do not use it in an application.



54
55
56
# File 'lib/paper_trail_history.rb', line 54

def reset_config!
  @config = Configuration.new
end