diff --git a/doc/warning_about_not_setting_whodunnit.md b/doc/warning_about_not_setting_whodunnit.md new file mode 100644 index 00000000..e4332f02 --- /dev/null +++ b/doc/warning_about_not_setting_whodunnit.md @@ -0,0 +1,32 @@ +# 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 +> longer adds the set_paper_trail_whodunnit before_filter for you. Please add this +> before_filter to your ApplicationController to continue recording whodunnit. + +## You want to track whodunnit + +Add the set_paper_trail_whodunnit before_filter to your ApplicationController. +See the PaperTrail readme for an example (https://git.io/vrTYG). + +## 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 +``` diff --git a/lib/paper_trail/frameworks/rails/controller.rb b/lib/paper_trail/frameworks/rails/controller.rb index 404f6671..822c183a 100644 --- a/lib/paper_trail/frameworks/rails/controller.rb +++ b/lib/paper_trail/frameworks/rails/controller.rb @@ -98,8 +98,8 @@ module PaperTrail user_for_paper_trail is present, but whodunnit has not been set. PaperTrail no longer adds the set_paper_trail_whodunnit before_filter for you. Please add this before_filter to your - ApplicationController to continue recording whodunnit. See the - PaperTrail readme for an example. + ApplicationController to continue recording whodunnit. For more + information, please see https://git.io/vrTsk EOS end end