Merge pull request #43 from strongloop/juggler-tidyup
Fix the id and property access
This commit is contained in:
commit
fb70a838a6
|
@ -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}
|
||||||
};
|
};
|
||||||
|
|
|
@ -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');
|
||||||
|
@ -588,4 +588,4 @@ describe('Model', function() {
|
||||||
// throw new Error('not implemented');
|
// throw new Error('not implemented');
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue