Merge pull request #227 from fabien/fix/definition-tojson
Fix ModelDefinition toJSON bug
This commit is contained in:
commit
38431753a1
|
@ -265,7 +265,7 @@ ModelDefinition.prototype.toJSON = function (forceRebuild) {
|
||||||
this.json = null;
|
this.json = null;
|
||||||
}
|
}
|
||||||
if (this.json) {
|
if (this.json) {
|
||||||
return json;
|
return this.json;
|
||||||
}
|
}
|
||||||
var json = {
|
var json = {
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
|
|
@ -37,6 +37,8 @@ describe('ModelDefinition class', function () {
|
||||||
assert.equal(json.properties.joinedAt.type, "Date");
|
assert.equal(json.properties.joinedAt.type, "Date");
|
||||||
assert.equal(json.properties.age.type, "Number");
|
assert.equal(json.properties.age.type, "Number");
|
||||||
|
|
||||||
|
assert.deepEqual(User.toJSON(), json);
|
||||||
|
|
||||||
done();
|
done();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue