MartOn
2006-Dec-16 00:39 UTC
Optimizing find with :include on a has_many :though relation (bug or feature?)
Hello all I was hoping somebody could help me with this optimizing problem: I have pasted the problem here: http://pastie.caboo.se/27946 so it is more readable I would like to know if this is expected behavior in rails or if I''m doing something wrong. I''m running on EdgeRails. /MartOn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Michael Kovacs
2006-Dec-16 02:43 UTC
Re: Optimizing find with :include on a has_many :though relation (bug or feature?)
Have you tried: :include => {:assignments => :employment} when loading your Assets instead? You''re using the relation of the relation and this will tell rails to load it I didn''t try it on your example as I don''t have any has_many :through relations in my DB schema but I use this on my other relations all the time. Hope it helps. -Michael http://javathehutt.blogspot.com On Dec 15, 2006, at 4:39 PM, MartOn wrote:> > Hello all > > I was hoping somebody could help me with this optimizing problem: > I have pasted the problem here: http://pastie.caboo.se/27946 so it is > more readable > > I would like to know if this is expected behavior in rails or if I''m > doing something wrong. > I''m running on EdgeRails. > > /MartOn > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---