2016-05-10 16:40:36 -04: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-02 21:49:17 -04: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 16:40:36 -04:00
|
|
|
|
|
|
|
## You want to track whodunnit
|
|
|
|
|
2016-09-02 21:49:17 -04:00
|
|
|
Add the set_paper_trail_whodunnit before_action to your ApplicationController.
|
2016-05-15 03:29:07 -04:00
|
|
|
See the PaperTrail readme for an example (https://git.io/vrsbt).
|
2016-05-10 16:40:36 -04: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
|
|
|
|
|
|
|
|
To disable this warning for any other reason, use `skip_after_action`.
|
|
|
|
|
|
|
|
```
|
|
|
|
skip_after_action :warn_about_not_setting_whodunnit
|
|
|
|
```
|