I had a couple more ideas just after I posted. Marnen Laibow-Koser wrote: > Michael Schuerig wrote: [...] >> :joins with a symbol does an inner join. > > So use an SQL fragment if you need an outer join (which, on reflection, > I suppose you do).
On further reflection, I don't know why you would need an outer join unless not every Article has a Version associated. Is that the case? > >> When there are several draft >> versions, which one would I get? Answer: any. I want a specific one: the >> latest. > > You can specify conditions and sort order on fields from joined tables. > That should do the trick. Another (possibly zany) idea: group the versions by article_id. Are you ultimately trying to retrieve the latest version only for each article? That's what you imply, but a couple of things you wrote made me thing that you might want to retrieve multiple versions. Which is it? [...] Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from my iPhone -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.