Rails including different levels of nested has_many relationships
<p>So, I've got three ActiveRecord models. On User is 2 has_many relationships, one for <code>:accounts</code> and one for <code>:authorizations</code> which is an alias for a collection of transactions. Account has a collection of <code>:transactions</code>.</p>

<ol>
<li>User</li>
<li>Account</li>
<li>Transaction</li>
</ol>

<p>So far, I have been able to include User, its <code>:accounts</code> and its <code>:transactions</code> using:</p>

<p><code>@user.to_json(:include =&gt; {:accounts =&gt; {:include =&gt; :transactions}})</code></p>

<blockquote>
  <p>I want to include the collection of transactions called
  <code>:authorizations</code> that User has as well. How can I do this? </p>
</blockquote>