Merge pull request #1197 from strongloop/fix/options-propagation
Fix HasOne.update to propagate options arg
This commit is contained in:
commit
a9a4fa498d
|
@ -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)));
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue