• Answers
  • Web

Rails Cascading Includes

Why can't I do cascading includes in ruby on rails:


Tree.find(:first, :include => {:children => {:children => :children}})


I get an error for 3 cascading joins but not 2


Share Send to a friend Watch Report
 
 

2 Posted Answers
Order by

 
8 helpful answers
Agile like Ninja 42squared

I am wondering why you would need to pull all of that information at once?  Could you not simply do the one include at first and simply  for child in children.children later on when you need it?  Can you give a example of why you are needing the cascading includes?

Posted 2006-08-19T02:07:41Z
hornbeck was invited by Yedda to answer this question.

 

I want to load all of the comments for a post with one query.  I actually figured out this was an error and submitted a patch for it:

http://dev.rubyonrails.org/changeset/4776

Posted 2006-08-19T02:30:25Z

Sign in to participate

Got an answer for richcollins? Would you like to comment on the posted answers, or vote for the one which you think is the best?

Sign up for a free account, or sign in (if you're already a member).

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


Q:

Using Ruby on Rails to build large sites?

Can you build a site using Ruby on Rails that can handle the traffic levels of Myspace?
Submitted by sudonim   3 years ago.
  • viewed 3218 times
Last answer posted 2 years ago by Kuchmuch


Q:

Detecting tranactions in Ruby on Rails

I have a Ruby on Rails question: I need a way to detect if the code is executing under a transaction. So that I'll be able to ...
Submitted by pacman   3 years ago.
  • viewed 2576 times
Last answer posted 3 years ago by rholliday


Q:

Using Ruby for internal CRM app

I am about to start developing a new internal web application for the company I work for. It will be a lightweight CRM app ...
Submitted by Marti   3 years ago.
  • viewed 2381 times
Last answer posted 3 years ago by david_terrar



» More...

Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
  • Answers
  • Web
Copyright © 2006-2009, Yedda Inc. and respective copyright owners · CC License