artha42/mm-versionable — pull request #6 by alexkwolfe (2012-01-12 22:29:48+00:00)
Title: Options for cleaning up old versions

The `:max` option is a synonym for the :limit option. It sets the maximum number of versions of a document. By default :max is nil, which indicates that an unlimited number of versions will be kept. The previously documented `limit: 0` caused no versions to be kept, rather than an unlimited number as stated in the readme.

The `:destroy` option defaults to true. It causes all versions to be destroyed when the document is destroyed.

The `:prune` option defaults to true. It causes all the versions over the maximum to be destroyed. When set to false, unpruned versions can be retrieved with the #all_versions method.

Previous behavior can be reproduced with `enable_versioning limit: 10, destroy: false, prune: false`.

The `versioned` method has been added as an alias to #enable_versioning.

A common default might be `versioned max: 10`. This will keep a maximum of 10 versions of a document. All old versions will be automatically destroyed. Versions of a destroyed document will also be destroyed.