From 932708349e3318ff63a1dfa98697b1b7c89bd5e4 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Tue, 23 Jun 2009 10:59:32 +0100 Subject: [PATCH] Added info on reverting and undeleting. --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7a790535..118c8700 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PaperTrail -Track changes to your models' data. Good for auditing or versioning. +PaperTrail lets you track changes to your models' data. It's good for auditing or versioning. You can see how a model looked at any stage in its lifecycle, revert it to any version, and even undelete it after it's been destroyed. ## Features @@ -87,15 +87,21 @@ Here's a helpful table showing what PaperTrail stores: PaperTrail stores the values in the Model Before column. Most other auditing/versioning plugins store the After column. -## Undeleting A Model +## Reverting And Undeleting A Model -PaperTrail makes undeleting easy: +PaperTrail makes reverting to a previous version easy: + + >> widget = Widget.find 42 + >> widget.update_attributes :name => 'Blah blah' + # Time passes.... + >> widget = widget.versions.last.reify # the widget as it was before the update + >> widget.save # reverted + +Undeleting is just as simple: >> widget = Widget.find 42 >> widget.destroy - # Time passes.... - >> widget = Version.find(153).reify # the widget as it was before it was destroyed >> widget.save # the widget lives!