Make auto_validations plugin handle models that select from subqueries