From 3f0a0276fe305855f11e0632fc4a4da408a02bf7 Mon Sep 17 00:00:00 2001 From: Ben Atkins Date: Tue, 22 Jul 2014 19:40:11 -0400 Subject: [PATCH] Update CHANGELOG + README as per #397 [ci skip] --- CHANGELOG.md | 5 +++++ README.md | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f3fe982..e7bf5185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ ## 3.0.3 +##### Breaking Change: If you use a custom initializer for PaperTrail in conjunction with Rails, you will need to add this line of code to the beginning of it: +```ruby +PaperTrail::Rails::Engine.eager_load! +``` + - [#386](https://github.com/airblade/paper_trail/issues/386) - Fix eager loading of `versions` association with custom class name in `ActiveRecord` 4.1. - [#384](https://github.com/airblade/paper_trail/issues/384) - Fix `VersionConcern#originator` instance method. diff --git a/README.md b/README.md index b21cca5f..f2db5816 100644 --- a/README.md +++ b/README.md @@ -481,6 +481,10 @@ You can avoid having to do this manually by setting your initializer to pick up ```ruby # config/initializers/paper_trail.rb + +# the following line is required for PaperTrail >= 3.0.3 with Rails +PaperTrail::Rails::Engine.eager_load! + if defined?(::Rails::Console) PaperTrail.whodunnit = "#{`whoami`.strip}: console" elsif File.basename($0) == "rake" @@ -556,6 +560,11 @@ If you only use custom version classes and don't use PaperTrail's built-in one, - either declare the `PaperTrail::Version` class to be abstract like this (in an initializer): ```ruby +# config/initializers/paper_trail.rb + +# the following line is required for PaperTrail >= 3.0.3 with Rails +PaperTrail::Rails::Engine.eager_load! + PaperTrail::Version.module_eval do self.abstract_class = true end