Fix the id and property access

This commit is contained in:
Raymond Feng 2013-10-04 15:51:48 -07:00
parent 384029a736
commit 858ec8714d
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@ var Model = require('../loopback').Model
*/
var properties = {
id: {type: String, generated: true},
id: {type: String, generated: true, id: 1},
uid: {type: String},
ttl: {type: Number, ttl: true}
};

View File

@ -458,9 +458,9 @@ describe('Model', function() {
var MyModel = loopback.createModel('foo', props);
Object.keys(MyModel.properties).forEach(function (key) {
var p = MyModel.properties[key];
var o = MyModel.properties[key];
Object.keys(MyModel.definition.properties).forEach(function (key) {
var p = MyModel.definition.properties[key];
var o = MyModel.definition.properties[key];
assert(p);
assert(o);
assert(typeof p.type === 'function');