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

.changed() detects value as changed when set from null to null. #3812

Closed
JrSchild opened this Issue May 27, 2015 · 2 comments

Comments

3 participants
@JrSchild

JrSchild commented May 27, 2015

If the value of an instance was null and is .set() to null, Sequelize detects the value as changed.
Using sequelize 3.1.1.

@mickhansen mickhansen added the bug label May 27, 2015

@Thomathan

This comment has been minimized.

Thomathan commented May 27, 2015

instance.js has a primitives array and only compares values that match it. Since null is a primitive it should be included as well.

However, typeof null returns object which seems to be bug in ecmascript.

Will probably need to explicitly check for null.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null
http://www.ecma-international.org/ecma-262/5.1/#sec-4.3.2
http://www.ecma-international.org/ecma-262/5.1/#sec-4.3.11

@JrSchild

This comment has been minimized.

JrSchild commented May 27, 2015

Thank you for the fast response. I can confirm that it fixes the issue.

mickhansen added a commit that referenced this issue May 28, 2015

Merge pull request #3817 from BridgeAR/master
Fix two minor issues. Closes #3812 and #3770

IrfanBaqui pushed a commit to IrfanBaqui/sequelize that referenced this issue Jun 24, 2015

IrfanBaqui pushed a commit to IrfanBaqui/sequelize that referenced this issue Jun 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment