Merge branch 'release/2.1.1' into production
This commit is contained in:
commit
f11ac18b55
|
@ -467,6 +467,10 @@ HasMany.prototype.findById = function (fkId, cb) {
|
|||
filter.where[idName] = fkId;
|
||||
filter.where[fk] = modelInstance[pk];
|
||||
|
||||
if (filter.where[fk] === undefined) {
|
||||
// Foreign key is undefined
|
||||
return process.nextTick(cb);
|
||||
}
|
||||
this.definition.applyScope(modelInstance, filter);
|
||||
|
||||
modelTo.findOne(filter, function (err, inst) {
|
||||
|
@ -919,6 +923,11 @@ BelongsTo.prototype.related = function (refresh, params) {
|
|||
var query = {where: {}};
|
||||
query.where[pk] = modelInstance[fk];
|
||||
|
||||
if (query.where[pk] === undefined) {
|
||||
// Foreign key is undefined
|
||||
return process.nextTick(cb);
|
||||
}
|
||||
|
||||
this.definition.applyScope(modelInstance, query);
|
||||
|
||||
modelTo.findOne(query, function (err, inst) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "loopback-datasource-juggler",
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.1",
|
||||
"description": "LoopBack DataSoure Juggler",
|
||||
"keywords": [
|
||||
"StrongLoop",
|
||||
|
|
Loading…
Reference in New Issue