From 858ec8714d751273320e0fcfaead68dca1599272 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Fri, 4 Oct 2013 15:51:48 -0700 Subject: [PATCH] Fix the id and property access --- lib/models/session.js | 2 +- test/model.test.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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 +});