From 02b1c09e3e45a9fb69d1bdb6e7fa69bbfe4d5142 Mon Sep 17 00:00:00 2001 From: Ninigi Date: Wed, 23 Sep 2015 14:53:01 +0200 Subject: [PATCH] updated readme --- README.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 31adb4f0..fff9506e 100644 --- a/README.md +++ b/README.md @@ -332,27 +332,22 @@ a.versions.last.event # 'update' You can also use the corresponding callback-methods seperately instead of using the :on option. If you choose to use the callback-methods, PaperTrail will only -track the according events - so `paper_trail_create` is basically the same as +track the according events - so `paper_trail_on_create` is basically the same as `has_paper_trail :on => :create`. ```ruby class Article < ActiveRecord::Base - paper_trail_destroy - # or paper_trail_after_destroy - # paper_trail_destroy(:before) will create the version before the actual - # destroy event - - paper_trail_update - paper_trail_create + has_paper_trail + paper_trail_on_destroy + paper_trail_on_update + paper_trail_on_create end ``` The `paper_trail_destroy` method can be configured to be called `:before` or `:after` the destroy event. This can be usefull if you are using a third party tool that alters the destroy method (for example paranoia). If you do not pass an argument, it will default -to after_destroy. -`paper_trail_after_destroy` and `paper_trail_before_destroy` are alias methods for -`paper_trail_destroy(:before/:after)`. +to after_destroy. ## Choosing When To Save New Versions