How to set whodunnit for paper_trail when creating a new user?
<p>The paper_trail gem tracks versions, and does a good job. However, there is one edge case I've been noticing. For most objects, the application controller sets whodunnit if you are logged in, and then all objects that are created during that session have a version that records "whodunnit" according to who is logged in.</p>

<p>The interesting case is where nobody is logged in because a new user is signing up. The user is created with a "nil" whodunnit, which is wrong because actually the user was created by themselves. </p>

<p>Of course, whodunnit can't know the id of the user before the user record is saved. I know this.</p>

<p>However, this creates a conflict later, as various batch jobs also modify user records, and not being in a web session, also create versions with nil whodunnit records.</p>

<p>Now I can't tell who created the user - some batch import process, or the user.</p>

<p>I'm pondering various solutions, like perhaps rummaging around the Papertrail::Versions table for that object and fixing whodunnit, but that seems pretty unclean.</p>

<p>Any advice?</p>