From 12a9ca9b313507e3338a3aa4489a6c002b7a9930 Mon Sep 17 00:00:00 2001 From: Ben Atkins Date: Wed, 12 Mar 2014 15:02:34 -0400 Subject: [PATCH] Adjust language in README for abstract class declaration; rename key assignment appropriately for PaperTrail.enabled_for_model --- README.md | 2 +- lib/paper_trail.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7198ed9d..6338adad 100644 --- a/README.md +++ b/README.md @@ -553,7 +553,7 @@ Alternatively you could store certain metadata for one type of version, and othe If you only use custom version classes and don't use PaperTrail's built-in one, on Rails `>= 3.2` you must: -- either declare PaperTrail's version class abstract like this (in `config/initializers/paper_trail_patch.rb`): +- either declare the `PaperTrail::Version` class to be abstract like this (in an initializer): ```ruby PaperTrail::Version.module_eval do diff --git a/lib/paper_trail.rb b/lib/paper_trail.rb index 8f0e78aa..9c68bd41 100644 --- a/lib/paper_trail.rb +++ b/lib/paper_trail.rb @@ -34,12 +34,12 @@ module PaperTrail # Sets whether PaperTrail is enabled or disabled for this model in the current request. def self.enabled_for_model(model, value) - paper_trail_store[:"request_enabled_for_#{model}"] = value + paper_trail_store[:"enabled_for_#{model}"] = value end # Returns `true` if PaperTrail is enabled for this model in the current request, `false` otherwise. def self.enabled_for_model?(model) - !!paper_trail_store.fetch(:"request_enabled_for_#{model}", true) + !!paper_trail_store.fetch(:"enabled_for_#{model}", true) end # Set the field which records when a version was created.