title: Prevent Papertrail's changeset from triggering N+1 queries
body: <p>I have setup the Papertrail gem to track changes to my notes table. I want to show all the &quot;updates&quot; made to a note. I am doing this by:</p>
  <p><code>Annotation.last.versions.each { |v| v.changeset }</code></p>
  <p>This works, but is making unnecessary queries back to the Note table.</p>
  <p>If a Note has N versions, then v.changeset does N queries to the Note table to get the same note. I assume this is because I have setup my relationship incorrectly. My set up is below.</p>
  <pre class="lang-rb prettyprint-override"><code>class Note &lt; ActiveRecord::Base
  
    has_paper_trail(versions: { class_name: 'NoteVersion' })
  
  End
  </code></pre>
  <pre class="lang-rb prettyprint-override"><code>class NoteVersion &lt; PaperTrail::Version
  
    belongs_to(:note, foreign_key: :item_id, inverse_of: :versions)
  
  End
  </code></pre>
  <p>My versions table has the tables: <code>item_type</code>, <code>item_id</code>, <code>object</code>, <code>object_changes</code> and a few others.</p>