New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload doesn't synchronize a null include #4353

Closed
glutentag opened this Issue Aug 20, 2015 · 0 comments

Comments

2 participants
@glutentag

glutentag commented Aug 20, 2015

Hello,
When you reload an instance after having destroyed a hasOne association instance, instance.dataValues.association is set to null, but instance[association] still has the previous value.

In instance.js set method, _setInclude is called only if there is a value

if (this.options && this.options.include && this.options.includeNames.indexOf(key) !== -1 && value) {
    this._setInclude(key, value, options); 

also, in _setInclude, the value is set to null only if it is an object with null primary key

isEmpty = value && value[primaryKeyAttribute] === null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment