HasManythrough generation