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 -~----------~----~----~----~------~----~------~--~---

