When faced with similar limitations, I ended up writing a plugin that allowed me to do my own custom SQL when pulling in associations. Some things are just too tough to try to do through automated SQL generation.
Check out my blog post at http://kellogg-assoc.com/articles/2006/11/05/eager-finder-sql or just go to the RubyForge page at http://rubyforge.org/projects/eagerfindersql Best of luck, Gregg On Jul 1, 2:43 pm, "Michael Koziarski" <[EMAIL PROTECTED]> wrote: > > You are more familiar with the code than me, so I could be overlooking > > something here. However if you append association :order to the end > > of the ORDER clause, it shouldn't affect the main :order specified in > > the base query. Likewise, leaving the assocation :order it out of the > > ID-fetching query ensures we get the right number of, and correct base > > objects. If I'm totally missing your point please explain. > > Leaving the order out of the id-fetching query means you're paging > through the list, *then* sorting. So if you have a limit of three, > and ordering by name, you could easily see: > > Page 1 > * Marcus > * Michael > * Stephen > > Page 2 > * Aaron > * James > * Oliver > > Page 3 > * Adam > * Scott > * Thomas > > That's quite a counter intuitive result if someone's clicked to order > by name and paging through the system. > > -- > Cheers > > Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" 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-core?hl=en -~----------~----~----~----~------~----~------~--~---
