From 0d862890e0b5b1c1d22c0de42a1368def18e98e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Tue, 20 Dec 2016 11:40:22 +0100 Subject: [PATCH 1/2] Fix HasOne.update to propagate options arg --- lib/relation-definition.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/relation-definition.js b/lib/relation-definition.js index 342ffe40..37447ac6 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -1743,7 +1743,7 @@ HasOne.prototype.update = function(targetModelData, options, cb) { this.fetch(function(err, targetModel) { if (targetModel instanceof ModelBaseClass) { delete targetModelData[fk]; - targetModel.updateAttributes(targetModelData, cb); + targetModel.updateAttributes(targetModelData, options, cb); } else { cb(new Error(g.f('{{HasOne}} relation %s is empty', definition.name))); } From 2ca081216b9b2df04c178ec3e0a4fd5cb158b974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Tue, 20 Dec 2016 17:37:25 +0100 Subject: [PATCH 2/2] Fix eslint errors reported by the latest eslint --- test/discovery.test.js | 60 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/test/discovery.test.js b/test/discovery.test.js index 1a1b8409..ec742969 100644 --- a/test/discovery.test.js +++ b/test/discovery.test.js @@ -35,36 +35,36 @@ describe('Memory connector with mocked discovery', function() { dataScale: null, nullable: 0, }, - { - owner: 'STRONGLOOP', - tableName: 'INVENTORY', - columnName: 'LOCATION_ID', - dataType: 'varchar', - dataLength: 20, - dataPrecision: null, - dataScale: null, - nullable: 0, - }, - { - owner: 'STRONGLOOP', - tableName: 'INVENTORY', - columnName: 'AVAILABLE', - dataType: 'int', - dataLength: null, - dataPrecision: 10, - dataScale: 0, - nullable: 1, - }, - { - owner: 'STRONGLOOP', - tableName: 'INVENTORY', - columnName: 'TOTAL', - dataType: 'int', - dataLength: null, - dataPrecision: 10, - dataScale: 0, - nullable: 1, - }]; + { + owner: 'STRONGLOOP', + tableName: 'INVENTORY', + columnName: 'LOCATION_ID', + dataType: 'varchar', + dataLength: 20, + dataPrecision: null, + dataScale: null, + nullable: 0, + }, + { + owner: 'STRONGLOOP', + tableName: 'INVENTORY', + columnName: 'AVAILABLE', + dataType: 'int', + dataLength: null, + dataPrecision: 10, + dataScale: 0, + nullable: 1, + }, + { + owner: 'STRONGLOOP', + tableName: 'INVENTORY', + columnName: 'TOTAL', + dataType: 'int', + dataLength: null, + dataPrecision: 10, + dataScale: 0, + nullable: 1, + }]; ds.discoverModelProperties = function(modelName, options, cb) { process.nextTick(function() {