Allow `where` references association names as joined table alias names by kamipo · Pull Request #40106 · rails/rails

If a table is joined multiple times, those tables are aliased other than the first one. It happens easily on self referential associations, and in that case currently there is no way to work custom...