From 7a9b64f1bf1f2d377d3e9f9da0929d7acb4ff71d Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Tue, 29 Jul 2014 22:19:52 -0700 Subject: [PATCH] Fix the test failure for mongodb --- lib/relation-definition.js | 2 +- test/relations.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/relation-definition.js b/lib/relation-definition.js index b763c06e..69dc2117 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -1901,7 +1901,7 @@ RelationDefinition.referencesMany = function referencesMany(modelFrom, modelTo, var relationName = params.as || i8n.camelize(modelTo.pluralModelName, true); var fk = params.foreignKey || i8n.camelize(modelTo.modelName + '_ids', true); var idName = modelTo.dataSource.idName(modelTo.modelName) || 'id'; - var idType = modelTo.getPropertyType(idName); + var idType = modelTo.definition.properties[idName].type; var definition = modelFrom.relations[relationName] = new RelationDefinition({ name: relationName, diff --git a/test/relations.test.js b/test/relations.test.js index bcedc425..245b9bec 100644 --- a/test/relations.test.js +++ b/test/relations.test.js @@ -1663,7 +1663,7 @@ describe('relations', function () { cat.links.should.have.length(1); cat.items.add(product3, function(err, link) { link.should.be.instanceof(Link); - link.id.should.equal(product3.id); + link.id.should.eql(product3.id); link.name.should.equal('Product 3'); cat.links.should.have.length(2);