Fix uniqueness validation for inherited models.