I'm using eager loading pretty heavily and running up into a lot of
edge cases that I'd like to work on.  The latest is that :order
clauses on associations appear to be dropped when the association is
eager loaded.  This makes sense since you generally would want to
specify the order on your query, and it's prone to name collisions.
However the downside is that I'm doing a LOT of eager loading and it's
pretty ugly to be extending every single order clause through the
application with association orders (considering the associations will
always be ordered the same).  Throw in the fact that my :include
option is sometimes specified dynamically (for API use and such), and
constructing the proper order clause turns into a very significant
undertaking.

I'm wondering if any ActiveRecord experts in here can comment on the
feasibility of factoring :order options into eager-loaded associations
intelligently.  Ideally it would always use the associations order
clause unless the passed-in order clause contained a reference to the
eager-loaded table.  Given the table renaming and the possibility of
explicit joins, this could be complicated, but I think it could be
made to work reasonably well.  Any comments before I start work on a
patch?

-- 
Gabe da Silveira
http://darwinweb.net

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

Reply via email to