Permalink
Browse files

Fix copy&paste errors, closes #361

  • Loading branch information...
1 parent 01a30f0 commit 4b77f35aa2274c663923c99830d780be0b0858dd @1602 committed Jan 21, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/sql.js
View
@@ -46,13 +46,13 @@ BaseSQL.prototype.escapeId = function(id) {
if (this.schema.settings.slave) {
return '"' + id.toString().replace(/["\n]/g, '') + '"';
} else {
- var idNumber = Number(data.id);
+ var idNumber = Number(id);
if (isNaN(idNumber)) {
throw new Error('id is not a number');
}
return idNumber;
}
-}
+};
BaseSQL.prototype.save = function (model, data, callback) {
var sql = 'UPDATE ' + this.tableEscaped(model) + ' SET ' + this.toFields(model, data) + ' WHERE ' + this.escapeName('id') + ' = ' + this.escapeId(data.id);

1 comment on commit 4b77f35

Was just about to submit a PR for this. Thanks for the quick fix :)

Please sign in to comment.