2016-05-10 20:40:36 +00:00
|
|
|
# The warning about not setting whodunnit
|
|
|
|
|
|
|
|
After upgrading to PaperTrail 5, you see this warning:
|
|
|
|
|
|
|
|
> user_for_paper_trail is present, but whodunnit has not been set. PaperTrail no
|
2016-09-03 01:49:17 +00:00
|
|
|
> longer adds the set_paper_trail_whodunnit before_action for you. Please add this
|
|
|
|
> before_action to your ApplicationController to continue recording whodunnit.
|
2016-05-10 20:40:36 +00:00
|
|
|
|
|
|
|
## You want to track whodunnit
|
|
|
|
|
2017-04-27 17:32:02 +00:00
|
|
|
Add `before_action :set_paper_trail_whodunnit` to your ApplicationController.
|
2016-05-15 07:29:07 +00:00
|
|
|
See the PaperTrail readme for an example (https://git.io/vrsbt).
|
2016-05-10 20:40:36 +00:00
|
|
|
|
|
|
|
## You don't want to track whodunnit
|
|
|
|
|
|
|
|
If you no longer want to track whodunnit, you may disable this
|
|
|
|
warning by overriding user_for_paper_trail to return nil.
|
|
|
|
|
|
|
|
```
|
|
|
|
# in application_controller.rb
|
|
|
|
def user_for_paper_trail
|
|
|
|
nil # disable whodunnit tracking
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
## You just want the warning to go away
|
|
|
|
|
2017-04-27 17:32:02 +00:00
|
|
|
Upgrade to PT 6.
|
2016-05-10 20:40:36 +00:00
|
|
|
|
2017-04-27 17:32:02 +00:00
|
|
|
## Why does PT no longer add this callback for me?
|
|
|
|
|
|
|
|
So that you can control the order of callbacks. Maybe you have another callback
|
|
|
|
that must happen first, before `set_paper_trail_whodunnit`.
|