Skip to content
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
Closed

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

JrSchild opened this issue May 27, 2015 · 2 comments

Comments

@JrSchild
Copy link

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

@Thomathan
Copy link

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
Copy link
Author

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
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
Projects
None yet
Development

No branches or pull requests

3 participants