> As it turns out, extending the order clause doesn't even work for > eager loading with a limit clause since the initial query to find the > IDs doesn't include the joined table, and therefore the clause blows > up. ActiveRecord will need to parse the order string to prevent this > condition... As it is, I'll have to either not eager load the > association (n+1 ugh), or else sort the association after it is loaded > (not bad for small associations, but not very DRY). > > Does AR do any analysis of ORDER clauses currently?
Limits, orders etc with Eager includes are bit of a nonsense feature as is, and the limitations of their implementation highlights that. Rather than take some ad-hoc patches to fix a few specific broken cases, I think the best bet is to either: * Rethink how they can / should work to get something a little more robust; or * Figure out what situations won't work correctly with our current implementation and raise useful errors instead of 'kinda working'. Does anyone have any strong feelings on the matter? I'm sure some of the other ORMs like hibernate and toplink have an implementation that could provide clues to a sane approach? -- 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 -~----------~----~----~----~------~----~------~--~---
