Sigh, I have a new problem every day.
Okay I have a model that acts_as_tree, so I am trying to eager load the
objects + all of their children, plus their children''s children, and so
on. However, :include => :children alone doesn''t do this, and so
far
I''ve got something like:
:include => [{:children => [{:children => [:children, :upload]},
:upload]}, :upload, :tags])
Is that not absurd or what? It''s so far the only way I can avoid
queries during rendering. Unfortunately that assumes the depth of the
tree, when in actuality it can be far greater.
Should I limit the depth of the tree? This is for a discussion forum of
sorts. I don''t know if it''s typical to have potentially
infinite tree
depth in threaded forums.
Should I even worry about pre-loading all data before rendering or just
go with the flow? I''d like to cut down on the number of queries if
possible.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---