diff --git a/lib/models/session.js b/lib/models/session.js index 5636fd40..704edf5c 100644 --- a/lib/models/session.js +++ b/lib/models/session.js @@ -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} }; diff --git a/test/model.test.js b/test/model.test.js index 3c3966ac..1ac72441 100644 --- a/test/model.test.js +++ b/test/model.test.js @@ -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'); // }); // }); -}); \ No newline at end of file +});