From 008dad3f7632223f605db4b92a5eed16c06786c7 Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Sat, 27 Jun 2015 00:51:35 -0400 Subject: [PATCH] Docs: Limiting the Number of Versions Created - The terminology of "Object Instance" here is misleading. Conceptually, it is the record in the database which is tracked, not the instance of the ruby object in memory. In fact, there may be multiple instances of the record in memory, e.g. in a multi-threaded server. - Also, we can't list all of the reasons someone might want to configure a limit. A readme should be concise. [ci skip] --- README.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0ae9cd0e..5226d9bd 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ revert it to any version, and even undelete it after it's been destroyed. - [Turning PaperTrail Off/On](#turning-papertrail-offon) - [Using a custom serializer](#using-a-custom-serializer) - [SerializedAttributes support](#serializedattributes-support) -- [Limiting the number of versions created per object instance](#limiting-the-number-of-versions-created-per-object-instance) +- [Limiting the Number of Versions Created](#limiting-the-number-of-versions-created) - [Deleting Old Versions](#deleting-old-versions) - [Testing](#testing) @@ -1137,19 +1137,15 @@ PaperTrail.config.serialized_attributes = false PaperTrail.serialized_attributes? ``` -## Limiting the number of versions created per object instance +## Limiting the Number of Versions Created -If you are wary of your `versions` table growing to an unwieldy size, or just -don't care to track more than a certain number of versions per object, there is -a configuration option that can be set to cap the number of versions saved per -object. Note that this value must be numeric, and it only applies to versions -other than `create` events (which will always be preserved if they are stored). +Configure `version_limit` to cap the number of versions saved per record. This +does not apply to `create` events. ```ruby -# will make it so that a maximum of 4 versions will be stored for each object -# (the 3 most recent ones plus a `create` event) +# Limit: 4 versions per record (3 most recent, plus a `create` event) PaperTrail.config.version_limit = 3 -# disables/removes the version limit +# Remove the limit PaperTrail.config.version_limit = nil ```