Merge branch 'release/2.1.1' into production

This commit is contained in:
Raymond Feng 2014-07-27 00:40:51 -07:00
commit f11ac18b55
2 changed files with 10 additions and 1 deletions

View File

@ -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) {

View File

@ -1,6 +1,6 @@
{
"name": "loopback-datasource-juggler",
"version": "2.1.0",
"version": "2.1.1",
"description": "LoopBack DataSoure Juggler",
"keywords": [
"StrongLoop",