Merge branch 'release/1.2.11' into production

This commit is contained in:
Raymond Feng 2014-09-22 09:05:32 -07:00
commit 76f719c3e8
3 changed files with 15 additions and 3 deletions

View File

@ -102,8 +102,8 @@ var modelHelper = module.exports = {
generateModelDefinition(rel.modelThrough, out);
}
}
for(var rm in referencedModels) {
generateModelDefinition(referencedModels[rm], out);
for (var i = 0, n = referencedModels.length; i < n; i++) {
generateModelDefinition(referencedModels[i], out);
}
return out;
},

View File

@ -1,6 +1,6 @@
{
"name": "loopback-explorer",
"version": "1.2.10",
"version": "1.2.11",
"description": "Browse and test your LoopBack app's APIs",
"main": "index.js",
"scripts": {

View File

@ -164,6 +164,18 @@ describe('model-helper', function() {
expect(defs).has.property('Model5');
expect(defs).has.property('Model6');
});
// https://github.com/strongloop/loopback-explorer/issues/49
it('should work if Array class is extended and no related models are found',
function() {
var Model7 = loopback.createModel('Model7', {street: String});
Array.prototype.customFunc = function() {
};
var defs = modelHelper.generateModelDefinition(Model7, {});
expect(defs).has.property('Model7');
expect(Object.keys(defs)).has.property('length', 1);
});
});
describe('hidden properties', function() {