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

Commit f6694790 by Josemando Sobral

paranoidClause is not checking if underscored is enabled

1 parent cfbec56a
Showing with 6 additions and 4 deletions
......@@ -1032,18 +1032,20 @@ module.exports = (function() {
options = options || {}
options.where = options.where || {}
var deletedAtCol = Utils._.underscoredIf(this.options.deletedAt, this.options.underscored)
// Don't overwrite our explicit deletedAt search value if we provide one
if (!!options.where[this.options.deletedAt]) {
if (!!options.where[deletedAtCol]) {
return options
}
if (typeof options.where === "string") {
options.where += ' AND ' + this.QueryInterface.quoteIdentifier(this.options.deletedAt) + ' IS NULL '
options.where += ' AND ' + this.QueryInterface.quoteIdentifier(deletedAtCol) + ' IS NULL '
}
else if (Array.isArray(options.where)) {
options.where[0] += ' AND ' + this.QueryInterface.quoteIdentifier(this.options.deletedAt) + ' IS NULL '
options.where[0] += ' AND ' + this.QueryInterface.quoteIdentifier(deletedAtCol) + ' IS NULL '
} else {
options.where[this.options.deletedAt] = null
options.where[deletedAtCol] = null
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!