[3.2] active_record: Fix regression in predicate builder for join aliases.

Fixes #9257

Backports pull #9262.