updated readme
This commit is contained in:
parent
baca9b0557
commit
02b1c09e3e
17
README.md
17
README.md
|
@ -332,27 +332,22 @@ 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
|
||||||
```
|
```
|
||||||
|
|
||||||
The `paper_trail_destroy` method can be configured to be called `:before` or `:after` the
|
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 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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue