Fix the test failure for mongodb

This commit is contained in:
Raymond Feng 2014-07-29 22:19:52 -07:00
parent e888b8cff9
commit 7a9b64f1bf
2 changed files with 2 additions and 2 deletions

View File

@ -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,

View File

@ -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);