不要怂,就是干,撸起袖子干!

Commit cc439041 by Mick Hansen

Merge pull request #3571 from sequelize/hotfix/model-wide-validation

Fix condition in model wide validation
2 parents c3a4ba9f 91ec5f06
Showing with 1 additions and 1 deletions
...@@ -327,7 +327,7 @@ var Pub = Sequelize.define('Pub', { ...@@ -327,7 +327,7 @@ var Pub = Sequelize.define('Pub', {
}, { }, {
validate: { validate: {
bothCoordsOrNone: function() { bothCoordsOrNone: function() {
if ((this.latitude === null) === (this.longitude === null)) { if ((this.latitude === null) !== (this.longitude === null)) {
throw new Error('Require either both latitude and longitude or neither') throw new Error('Require either both latitude and longitude or neither')
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!