This is a ticket to track the many improvements we need to make on contain() and friends:
$table->aliasField() as a way to help us minimise the risk of using the wrong alias.Change the alias dynamically would be really handy, creating another Association isn't the best idea. Any idea if/when this will be implemented?
An easy fix for setting alias on matching would be for the first param to support array and use the same format as leftJoin which where table can be ['alias' => 'tablename']
Disclaimer: I haven't looked into the matching code ;-)
Setting a temporary alias in matching/contain could be pretty useful.
This issue is stale because it has been open for 120 days with no activity. Remove the stale label or comment or this will be closed in 15 days
Most helpful comment
Setting a temporary alias in matching/contain could be pretty useful.