Check if association.alias is set before checking the length

same as in association.type == 'model'