Merge branch 'release/2.6.0' into production
This commit is contained in:
commit
ffe1ead124
|
@ -1884,6 +1884,24 @@ DataSource.prototype.ready = function (obj, args) {
|
|||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Ping the underlying connector to test the connections
|
||||
* @param {Function} [cb] Callback function
|
||||
*/
|
||||
DataSource.prototype.ping = function (cb) {
|
||||
var self = this;
|
||||
if (self.connector.ping) {
|
||||
this.connector.ping(cb);
|
||||
} else if (self.connector.discoverModelProperties) {
|
||||
self.discoverModelProperties('dummy', {}, cb);
|
||||
} else {
|
||||
process.nextTick(function () {
|
||||
var err = self.connected ? null : 'Not connected';
|
||||
cb(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Define a hidden property
|
||||
* @param {Object} obj The property owner
|
||||
|
|
|
@ -2107,6 +2107,7 @@ EmbedsMany.prototype.destroyById = function (fkId, cb) {
|
|||
modelInstance.updateAttribute(propertyName,
|
||||
embeddedList, function(err) {
|
||||
cb(err);
|
||||
modelTo.emit('deleted', inst.id, inst.toJSON());
|
||||
});
|
||||
}
|
||||
} else if (typeof cb === 'function') {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "loopback-datasource-juggler",
|
||||
"version": "2.5.2",
|
||||
"version": "2.6.0",
|
||||
"description": "LoopBack DataSoure Juggler",
|
||||
"keywords": [
|
||||
"StrongLoop",
|
||||
|
|
|
@ -7,7 +7,6 @@ describe('basic-querying', function () {
|
|||
|
||||
before(function (done) {
|
||||
db = getSchema();
|
||||
|
||||
User = db.define('User', {
|
||||
seq: {type: Number, index: true},
|
||||
name: {type: String, index: true, sort: true},
|
||||
|
@ -22,6 +21,15 @@ describe('basic-querying', function () {
|
|||
|
||||
});
|
||||
|
||||
describe('ping', function () {
|
||||
it('should be able to test connections', function (done) {
|
||||
db.ping(function (err) {
|
||||
should.not.exist(err);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('findById', function () {
|
||||
|
||||
before(function (done) {
|
||||
|
|
Loading…
Reference in New Issue