title: How do I set current_user in middleware?
body: <p>To give more background to my question, please refer to this Github issue - <a href="https://github.com/getsentry/raven-ruby/issues/144">https://github.com/getsentry/raven-ruby/issues/144</a> </p>
  
  <p>I am using <code>raven</code> which is an error logger. I want to add the id for the <code>current_user</code> if user is logged in. The answer I received was</p>
  
  <blockquote>
    <p>This should be done via your middleware or somewhere similar. </p>
  </blockquote>
  
  <p>where <em>this</em> means setting the current_user in Raven. </p>
  
  <p>I have read about middlewares, but still have not been able to figure out how can I get <code>current_user</code> in one. </p>