Predictable Table Aliases in Joins

Hi,

with our plugin, we are increasingly running into issues with the hard- to-predict table alias assignment in ActiveRecord. The alias assignment currently depends on the order of join associations to one table. When using named_scopes with flexible joins, it is hard to predict the table alias for conditions.

I would be happy to provide a patch for a more predictable association table alias scheme and described an API in

https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2357-predictable-table-aliases-in-joins

Please have a look and let me know what you think about that approach.

Cheers, Steffen