# Two branch nested includes

**URL:** <https://www.ruby-forum.com/t/two-branch-nested-includes/89865>\
**Category:** Rails\
**Created:** [March 23, 2007, 12:39pm UTC](https://www.ruby-forum.com/t/two-branch-nested-includes/89865 "2007-03-23T12:39:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RJRJRJ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@RJRJRJ](https://www.ruby-forum.com/u/RJRJRJ)\
**Post date:** [March 23, 2007, 12:39pm UTC](https://www.ruby-forum.com/t/two-branch-nested-includes/89865/1 "2007-03-23T12:39:27Z")

</div>

Hi all.

I have a project which has two “trees” branching out from it in terms of  
children. Currently I am nested including one branch:

@projects = Project.find(:all, :include =\> [:component =\> {:category =\>  
:testcase} ] )

but I am unsure how to include the second branch. Essentially I want to  
include the merge the following with the above:

@projects = Project.find(:all, :include =\> [:testsuite =\> {:build =\>  
:results} ] )

Also, what would be the syntax to include another level deep? Would it  
just be nesting another {} in there?

@projects = Project.find(:all, :include =\> [:testsuite =\> {:build =\>  
{:results =\> :testcasetemplate} } ] )

Many thanks,

RJ
