Eager loading and acts_as_tree

Hi all,

I have a node structure which acts_as_tree. I am pulling the first
two levels under the root node with:

@root = Node.find(1, :include => [ { :children =>
[ :children, :parent ] }, :parent ])

How do I pull out the first three levels? What about four?

@root = Node.find(1, :include => [ { :children => [ { :children =>
[:children, :parent] }, :parent ] }, :parent ])

gives me the following error:

Mysql::Error: Not unique table/alias: ‘childrens_nodes_2’

Many thanks in advance,
Nickolay

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs