title: How to get Job attributes in ActiveJob callback methods?
body: <p>Rails 4.2, active_jobs, callback_methods</p>
  
  <p>In the perform method of a custom Job I created a new record (and upload a file to S3).  How can I pass, or get, that new records id in the after_perform callback?  I want to send an email after_perform with a link to the S3 document...but, not sure how to get the id inside the after_perform method.  According to the docs you can use job.attributes, but I get 'undefined method attributes'.</p>
  
  <p>I could move the mailer call into the perform method, but Id rather handle it correctly using callbacks.  I am unsure how to access attributes (or where those attributes originate) outside of the perform method.</p>
  
  <p>I tried to do some detective work (to determine what attributes were available to the callback) by placing this in the callback:</p>
  
  <pre><code> puts "job: #{ job }"
  </code></pre>
  
  <p>or</p>
  
  <pre><code>puts "job: #{ job.attributes }"
  </code></pre>
  
  <p>or  </p>
  
  <pre><code>puts "job: #{ job.attributes.first }"
  </code></pre>
  
  <p>none of these worked, and all resulted in undefined 'attributes'.</p>