cascading-relations
Advanced tools
Comparing version 0.7.2 to 0.7.3
@@ -160,4 +160,6 @@ var Q, dot, mongoose; | ||
if (isArray) { | ||
orig.push(data._id); | ||
this.set(path, orig); | ||
if (orig.indexOf(data._id) < 0) { | ||
orig.push(data._id); | ||
this.set(path, orig); | ||
} | ||
} else { | ||
@@ -164,0 +166,0 @@ this.set(path, data._id); |
{ | ||
"name": "cascading-relations", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -263,3 +263,3 @@ var barClass, barSchema, bazClass, bazSchema, dot, fooClass, fooSchema, mongoose, relations, should; | ||
}); | ||
return it('should still work with deep dot notation', function() { | ||
it('should still work with deep dot notation', function() { | ||
var obj; | ||
@@ -343,2 +343,27 @@ obj = { | ||
}); | ||
return it('should be accurate when you put with less relations (implicit delete)', function(done) { | ||
var foo, | ||
_this = this; | ||
foo = new fooClass({ | ||
title: 'My Foo', | ||
_related: { | ||
_bars: [ | ||
{ | ||
title: 'First Bar' | ||
}, { | ||
title: 'Second Bar' | ||
} | ||
] | ||
} | ||
}); | ||
return foo.cascadeSave(function(err, res) { | ||
foo._bars.pop(); | ||
foo._related._bars.pop(); | ||
return foo.cascadeSave(function(err, res) { | ||
res._bars.length.should.equal(1); | ||
res._related._bars.length.should.equal(1); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43565
752