Tiny fixes

This commit is contained in:
Fabien Franzen 2014-09-05 17:28:50 +02:00
parent b4144598bf
commit d8cafd0c84
2 changed files with 2 additions and 1 deletions

View File

@ -1749,6 +1749,8 @@ EmbedsOne.prototype.related = function (refresh, params) {
} }
var embeddedInstance = modelInstance[propertyName]; var embeddedInstance = modelInstance[propertyName];
embeddedInstance.__persisted = true;
if (typeof params === 'function') { // acts as async getter if (typeof params === 'function') { // acts as async getter
var cb = params; var cb = params;
process.nextTick(function() { process.nextTick(function() {

View File

@ -82,7 +82,6 @@ describe('manipulation', function () {
err.should.be.instanceof(ValidationError); err.should.be.instanceof(ValidationError);
err.message.should.equal('The `Person` instance is not valid. Details: `id` can\'t be set.'); err.message.should.equal('The `Person` instance is not valid. Details: `id` can\'t be set.');
err.statusCode.should.equal(422); err.statusCode.should.equal(422);
inst.isNewRecord().should.be.true;
inst.id.should.equal(123456); inst.id.should.equal(123456);
inst.isNewRecord().should.be.true; inst.isNewRecord().should.be.true;
done(); done();