This repository was archived by the owner on May 17, 2021. It is now read-only.

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,8 @@ function listCollections(done, results) {
420420
var databases = results.databases;
421421

422422
// merge and de-dupe databases
423-
var dbnames = _.pick(databases, 'name');
424-
var tasks = _.map(dbnames, function(name) {
425-
return getDatabaseCollections.bind(null, db.db(name));
423+
var tasks = _.map(databases, function(_db) {
424+
return getDatabaseCollections.bind(null, db.db(_db.name));
426425
});
427426

428427
async.parallel(tasks, function(err, res) {
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,15 @@ var Instance = AmpersandModel.extend({
112112
props: true,
113113
derived: true
114114
}, true);
115+
116+
var model = this;
115117
if (this.databases.length > 0) {
116-
_.each(this._children, function(value, key) {
117-
res[key] = this[key].serialize();
118-
}, this);
119-
_.each(this._collections, function(value, key) {
120-
res[key] = this[key].serialize();
121-
}, this);
118+
_.each(model._children, function(value, key) {
119+
res[key] = model[key].serialize();
120+
});
121+
_.each(model._collections, function(value, key) {
122+
res[key] = model[key].serialize();
123+
});
122124
}
123125
return res;
124126
}
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ describe('fetch-mocked', function() {
254254
];
255255
});
256256

257-
it.skip('should lists all collections for each listable db', function(done) {
257+
it('should lists all collections for each listable db', function(done) {
258258
results.userInfo = fixtures.USER_INFO_JOHN;
259259
results.db = makeMockDB(null, [{
260260
'name': 'testCol'

0 commit comments

Comments
 (0)