datastar icon indicating copy to clipboard operation
datastar copied to clipboard

Wrong Schema.prototype.sufficientRemoveConditions function

Open k1tzu opened this issue 7 years ago • 1 comments

If 'key' is 0, for example uid: cql.int() and we try to remove uid = 0 like User.remove({uid: 0}); we get a false error in the function

Schema.prototype.sufficientRemoveConditions = function (conditions) {
  var keys = this.lookups
    ? Object.keys(this.lookupTables).concat(this.primaryKeys())
    : this.primaryKeys();

  return keys.every(function (key) {
    return !!conditions[key];
  });
};

"Must pass in all primary keys when using lookup tables"

k1tzu avatar Feb 01 '18 14:02 k1tzu

@k1tzu would love a pull-request to fix this issue! Great find

jcrugzz avatar Apr 17 '18 15:04 jcrugzz