diff --git a/README.md b/README.md index 2b1af5db..d4bf9782 100644 --- a/README.md +++ b/README.md @@ -135,17 +135,19 @@ When you declare `has_paper_trail` in your model, you get these methods: ```ruby class Widget < ActiveRecord::Base - has_paper_trail # you can pass various options here + has_paper_trail end -# Returns this widget's versions. You can customise the name of the association. +# Returns this widget's versions. You can customise the name of the +# association. widget.versions # Return the version this widget was reified from, or nil if it is live. # You can customise the name of the method. widget.version -# Returns true if this widget is the current, live one; or false if it is from a previous version. +# Returns true if this widget is the current, live one; or false if it is from +# a previous version. widget.live? # Returns who put the widget into its current state. @@ -160,7 +162,8 @@ widget.previous_version # Returns the widget (not a version) as it became next. widget.next_version -# Generates a version for a `touch` event (`widget.touch` does NOT generate a version) +# Generates a version for a `touch` event (`widget.touch` does NOT generate a +# version) widget.touch_with_version # Turn PaperTrail off for all widgets. @@ -169,9 +172,11 @@ Widget.paper_trail_off! # Turn PaperTrail on for all widgets. Widget.paper_trail_on! -# Check whether PaperTrail is enabled for all widgets. +# Is PaperTrail enabled for Widget, the class? Widget.paper_trail_enabled_for_model? -widget.paper_trail_enabled_for_model? # only available on instances of versioned models + +# Is PaperTrail enabled for widget, the instance? +widget.paper_trail_enabled_for_model? ``` And a `PaperTrail::Version` instance has these methods: @@ -282,32 +287,14 @@ usual. Here's a helpful table showing what PaperTrail stores: -
Event | -Model Before | -Model After | -
---|---|---|
create | -nil | -widget | -
update | -widget | -widget | -
destroy | -widget | -nil | -