-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix regression in util.toDefaultValue not returning the data types. Closes #3324, #3002 and #3410 #3733
Conversation
Only postgres has native |
return value().key; | ||
} else { | ||
return value(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you come up with something better?
Ready for review |
@@ -1792,6 +1794,13 @@ module.exports = (function() { | |||
} | |||
}; | |||
|
|||
Model.prototype.__getDefaultTimestamp = function(attr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're chaing to $
prefix for privates.
Ready for merge |
@@ -1024,7 +1025,7 @@ module.exports = (function() { | |||
delete defaults[this.Model._timestampAttributes.deletedAt]; | |||
} | |||
|
|||
if (Object.keys(defaults).length) { | |||
if (Object.keys(defaults).length !== 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the explicit one check. I'm uncertain if V8 handles it faster but this would not be measurable if. So it's just the style^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then there's really no reason to change it. It's better to keep style changes out of functional PR's so they can be discucssed seperately. I prefer the other style :)
It's back to the old style |
Rebased |
Fix typo Fix updatedAt and createdAt not always being 100% identical Use instanceof Abstract and remove __getTimestamp
@@ -139,7 +138,7 @@ var Utils = module.exports = { | |||
delete attributes[attribute]; | |||
} | |||
|
|||
if (_.isPlainObject(attributes[attribute])) { | |||
if (lodash.isPlainObject(attributes[attribute])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why lodash
insteadof _
?
Fix regression in util.toDefaultValue not returning the data types. Closes sequelize#3324, sequelize#3002 and sequelize#3410
I'm uncertain if UUIDV1 and UUIDV4 is actually right for mysql and mssql. I guess it should be just as the general UUID? Fixes #3324
(can't reproduce the error - seems to be fixed already).