Merge branch 'release/1.3.10' into production
This commit is contained in:
commit
2742b25c34
|
@ -119,9 +119,8 @@ Inclusion.include = function (objects, include, cb) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var inst = (obj instanceof self) ? obj : new self(obj);
|
var inst = (obj instanceof self) ? obj : new self(obj);
|
||||||
var relationMethod = inst[relationName];
|
// Calling the relation method on the instance
|
||||||
// FIXME: [rfeng] How do we pass in the refresh flag?
|
inst[relationName](function (err, result) {
|
||||||
relationMethod(function (err, result) {
|
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -340,10 +340,13 @@ Relation.belongsTo = function (anotherClass, params) {
|
||||||
|
|
||||||
// Define a property for the scope so that we have 'this' for the scoped methods
|
// Define a property for the scope so that we have 'this' for the scoped methods
|
||||||
Object.defineProperty(this.prototype, methodName, {
|
Object.defineProperty(this.prototype, methodName, {
|
||||||
enumerable: false,
|
enumerable: true,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
get: function () {
|
get: function () {
|
||||||
var fn = relationMethod.bind(this);
|
var fn = function() {
|
||||||
|
// Call the relation method on the declaring model instance
|
||||||
|
return relationMethod.apply(this, arguments);
|
||||||
|
}
|
||||||
// Set the remoting metadata so that it can be accessed as /api/<model>/<id>/<belongsToRelationName>
|
// Set the remoting metadata so that it can be accessed as /api/<model>/<id>/<belongsToRelationName>
|
||||||
// For example, /api/orders/1/customer
|
// For example, /api/orders/1/customer
|
||||||
fn.shared = true;
|
fn.shared = true;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "loopback-datasource-juggler",
|
"name": "loopback-datasource-juggler",
|
||||||
"version": "1.3.9",
|
"version": "1.3.10",
|
||||||
"description": "LoopBack DataSoure Juggler",
|
"description": "LoopBack DataSoure Juggler",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"StrongLoop",
|
"StrongLoop",
|
||||||
|
|
Loading…
Reference in New Issue