Skip to content

Commit 2fee789

Browse files
authored
Merge pull request #85 from strongloop/dremond_fix_replace_insert
fix: during replace, use id column name if specified
2 parents 7464c9d + 2ccbf91 commit 2fee789

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/ibmdb.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,9 @@ IBMDB.prototype._replace = function(model, where, data, options, callback) {
584584

585585
if (err) return cb(err);
586586

587-
data[idName] = selectData[0][idName];
587+
// need to use column name (if available)
588+
// when obtaining value from 'selectData'
589+
data[idName] = selectData[0][self.idColumn(model)];
588590
stmt = self.buildInsert(model, data);
589591

590592
connection.query(stmt, function(err, sData) {

0 commit comments

Comments
 (0)