Merge pull request #43 from strongloop/juggler-tidyup

Fix the id and property access
This commit is contained in:
Raymond Feng 2013-10-04 15:54:35 -07:00
commit fb70a838a6
2 changed files with 5 additions and 5 deletions

View File

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

View File

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