Farley, One workaround is not call "thing.widgets" but rather query on Widget directly; i.e. Widget.all(:thing_id => thing.id). Not as elegant, bit it avoids eager loading.
..tony.. On Mon, Feb 1, 2010 at 6:31 AM, Farley Knight <farleykni...@gmail.com>wrote: > Searching the group I noticed this question has been asked before, but > without much response: Is there a way to disable eager loading for a > particular relation? If not, for my entire installation? If there > isn't any easy way, maybe just a hint as to what source file this > logic is contained in.. Hopefully this is logic is not tightly coupled > our spread about various files. > > I'm having the issue that I'm calling something like > "thing.widgets.count" and instead of querying with something like > "select count(*) from widgets where widgets.thing_id = #{id}" I keep > running out of my already small amount of Dreamhost memory with a > query like "select id,name,description from widgets where > widgets.thing_id = #{id}". I think I redefined this method but still > had the same problem. > > Thanks, > - Farley > > -- > You received this message because you are subscribed to the Google Groups > "DataMapper" group. > To post to this group, send email to datamap...@googlegroups.com. > To unsubscribe from this group, send email to > datamapper+unsubscr...@googlegroups.com<datamapper%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/datamapper?hl=en. > > -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to datamap...@googlegroups.com. To unsubscribe from this group, send email to datamapper+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.