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

Fix regression in util.toDefaultValue not returning the data types. Closes #3324, #3002 and #3410 #3733

Merged
merged 2 commits into from
May 26, 2015

Conversation

BridgeAR
Copy link
Contributor

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).

@mickhansen
Copy link
Contributor

Only postgres has native UUID types, for mysql and other dialects we generate one with node-uuid

@BridgeAR BridgeAR changed the title Add testcase. Fixes #3324 Fix regression in util.toDefaultValue not returning the data types. Closes #3324 May 17, 2015
return value().key;
} else {
return value();
}
Copy link
Contributor Author

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?

@BridgeAR
Copy link
Contributor Author

Ready for review

@@ -1792,6 +1794,13 @@ module.exports = (function() {
}
};

Model.prototype.__getDefaultTimestamp = function(attr) {
Copy link
Contributor

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.

@BridgeAR
Copy link
Contributor Author

Ready for merge

@BridgeAR
Copy link
Contributor Author

I added a test for #3002 and #3410 so they can be closed too. Still waiting for merge ;)

@BridgeAR BridgeAR changed the title Fix regression in util.toDefaultValue not returning the data types. Closes #3324 Fix regression in util.toDefaultValue not returning the data types. Closes #3324, #3002 and #3410 May 20, 2015
@@ -1024,7 +1025,7 @@ module.exports = (function() {
delete defaults[this.Model._timestampAttributes.deletedAt];
}

if (Object.keys(defaults).length) {
if (Object.keys(defaults).length !== 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this?

Copy link
Contributor Author

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^^

Copy link
Contributor

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 :)

@BridgeAR
Copy link
Contributor Author

It's back to the old style

@BridgeAR
Copy link
Contributor Author

Rebased

Ruben Bridgewater added 2 commits May 22, 2015 19:59
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])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why lodash insteadof _?

mickhansen added a commit that referenced this pull request May 26, 2015
Fix regression in util.toDefaultValue not returning the data types. Closes #3324, #3002 and #3410
@mickhansen mickhansen merged commit e4cc50c into sequelize:master May 26, 2015
IrfanBaqui pushed a commit to IrfanBaqui/sequelize that referenced this pull request Jun 24, 2015
Fix regression in util.toDefaultValue not returning the data types. Closes sequelize#3324, sequelize#3002 and sequelize#3410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sequelize.Utils.toDefaultValue(Sequelize.UUIDV4) returns empty object
2 participants