Fix the id and property access
This commit is contained in:
parent
384029a736
commit
858ec8714d
|
@ -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}
|
||||
};
|
||||
|
|
|
@ -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');
|
||||
|
@ -588,4 +588,4 @@ describe('Model', function() {
|
|||
// throw new Error('not implemented');
|
||||
// });
|
||||
// });
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue