updated readme

This commit is contained in:
Ninigi 2015-09-23 14:53:01 +02:00
parent baca9b0557
commit 02b1c09e3e
1 changed files with 6 additions and 11 deletions

View File

@ -332,18 +332,15 @@ a.versions.last.event # 'update'
You can also use the corresponding callback-methods seperately instead of using 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 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`. `has_paper_trail :on => :create`.
```ruby ```ruby
class Article < ActiveRecord::Base class Article < ActiveRecord::Base
paper_trail_destroy has_paper_trail
# or paper_trail_after_destroy paper_trail_on_destroy
# paper_trail_destroy(:before) will create the version before the actual paper_trail_on_update
# destroy event paper_trail_on_create
paper_trail_update
paper_trail_create
end end
``` ```
@ -351,8 +348,6 @@ The `paper_trail_destroy` method can be configured to be called `:before` or `:a
destroy event. This can be usefull if you are using a third party tool that alters 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 destroy method (for example paranoia). If you do not pass an argument, it will default
to after_destroy. to after_destroy.
`paper_trail_after_destroy` and `paper_trail_before_destroy` are alias methods for
`paper_trail_destroy(:before/:after)`.
## Choosing When To Save New Versions ## Choosing When To Save New Versions