I forgot to mention that these error only come out in production environment. Everything goes well in development environment.
I don't understand why the action of find is different in production and development environment. I have read this post http://www.spacevatican.org/2008/4/29/include-and-conditions, and I know there are old and new ways of eager loading in rails. And in my case, the old way is exactly what I want to do. the last example in this post http://www.spacevatican.org/2008/6/22/the-difference-between-include-and-joins, did the same thing I post here, and it seems everything went ok, just like mine in development environment. I'm wondering are there anyone try running the same find in production environment? And does it output the same error? On 3月10日, 午後6:22, boblu <[email protected]> wrote: > Fred, thanks for the quick reply. > I did ask the same problem 5 month ago. > I managed to use join instead of include like this > > Lexeme.find(:all, :conditions=>'structures.id<10', :joins=>'left outer > join structures on structures.ref_id=lexemes.id and > structures.meta_id=0') > > Since usually I need to specify conditions that have both lexemes > table and structures table's fields, > I used SQL instead of regular association in the above joins, > because the regular association joins does a inner join which will > give me nothing when I only want to find those lexemes without any > structures. > > And now (5 month later), the reason I ask this question again are > 1. nobody gave me a reason why include goes wrong > 2. I really want a collection with eager loading instead of piles of > rows which joins gives. > > Sorry for my foolness, but I don't quite understand what you said here > > > the reason there's a difference > > when you don't have a condition on the structures table is that in > > that case AR does the include in a completely different way. > > Can you please explain this to me in details? > Thank you. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

