Module PaperTrail::Cleaner
In: lib/paper_trail/cleaner.rb

Methods

Public Instance methods

Destroys all but the most recent version(s) for items on a given date (or on all dates). Useful for deleting drafts.

Options:

  • :keeping - An `integer` indicating the number of versions to be kept for each item per date. Defaults to `1`.
  • :date - Should either be a `Date` object specifying which date to destroy versions for or `:all`, which will specify that all dates should be cleaned. Defaults to `:all`.
  • :item_id - The `id` for the item to be cleaned on, or `nil`, which causes all items to be cleaned. Defaults to `nil`.

[Validate]