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

Commit 28a35c30 by Mick Hansen

fix regression bug introduced by .and()/.or() implementation

1 parent f4b8b1bb
......@@ -908,7 +908,7 @@ module.exports = (function() {
if (treatAsAnd) {
return treatAsAnd
} else {
return !(arg instanceof Date) && ((arg instanceof Utils.and) || (arg instanceof Utils.or) || Utils.isHash(arg) || Array.isArray(arg))
return !(arg instanceof Date) && ((arg instanceof Utils.and) || (arg instanceof Utils.or) || Utils.isHash(arg))
}
}, false)
......
......@@ -119,6 +119,15 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
it('still allows simple arrays lookups', function (done) {
this.User.find({
where: ["id IN (?) OR id IN (?)", [1, 2], [3, 4]]
}).on('sql', function(sql) {
expect(sql).to.contain("id IN (1, 2) OR id IN (3, 4)")
done()
})
})
;(['find', 'findAll']).forEach(function(finderMethod) {
it('correctly handles complex combinations', function(done) {
this.User[finderMethod]({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!