Adjust language in README for abstract class declaration; rename key assignment appropriately for PaperTrail.enabled_for_model

This commit is contained in:
Ben Atkins 2014-03-12 15:02:34 -04:00
parent 5302f5ecc8
commit 12a9ca9b31
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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.