Replies: 1 comment
-
Maybe you found a solution but in cases others are looking for one: This article describes that case: https://www.railsagency.com/blog/2016/09/06/papertrail-polymorphic-whodunnit/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I managed to set up PaperTrail so that the
whodunnit
column storesUser #1
when an app user does a change (configured viaApplicationController.user_for_paper_trail
). I also managed to store info such asuserid: console
oruserid: rake task_context:task_name
via the PaperTrail initializer.However I did not find how to do the same for changes done through my RailsAdmin panels as an administrator. If I use the config below, it only stores in the
whodunnit
column the administrator ID and notAdministrator #1
, which is in my view not clear enough (is it a user or an administrator ID?):I tried the following too, but in that case the rails admin panel's "logout" button disappears:
I've defined a method
user_for_paper_trail
in my Admin::BaseController but it does not get called:What is the clean way to tell RailsAdmin to let my
user_for_paper_trail
be called by papertrail?Beta Was this translation helpful? Give feedback.
All reactions