_validateForeignKeyExistsInDatabase(foreignKeyName, foreignKeys) {
    if (Array.isArray(foreignKeys)) {
      let association = this.hasManyAssociationFks[foreignKeyName];

      let found;
      if (association.isPolymorphic) {
        found = foreignKeys.map(({ type, id }) => {
          return this._schema.db[
            this._schema.toInternalCollectionName(type)
          ].find(id);
        });
        found = compact(found);
      } else {
        found =
          this._schema.db[
            this._schema.toInternalCollectionName(association.modelName)
          ].find(foreignKeys);
      }

      let foreignKeyLabel = association.isPolymorphic
        ? foreignKeys.map((fk) => `${fk.type}:${fk.id}`).join(",")
        : foreignKeys;
      assert(
        found.length === foreignKeys.length,
        `You're instantiating a ${this.modelName} that has a ${foreignKeyName} of ${foreignKeyLabel}, but some of those records don't exist in the database.`
      );
    } else {
      let association = this.belongsToAssociationFks[foreignKeyName];

      let found;
      if (association.isPolymorphic) {
        found = this._schema.db[
          this._schema.toInternalCollectionName(foreignKeys.type)
        ].find(foreignKeys.id);
      } else {
        found =
          this._schema.db[
            this._schema.toInternalCollectionName(association.modelName)
          ].find(foreignKeys);
      }

      let foreignKeyLabel = association.isPolymorphic
        ? `${foreignKeys.type}:${foreignKeys.id}`
        : foreignKeys;
      assert(
        found,
        `You're instantiating a ${this.modelName} that has a ${foreignKeyName} of ${foreignKeyLabel}, but that record doesn't exist in the database.`
      );
    }
  }
Originally we validated this via association.setId method, but it triggered
    recursion. That method is designed for updating an existing model's ID so
    this method is needed during instantiation.

    @method _validateForeignKeyExistsInDatabase
    @private
    @hide