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

Commit ffaafdc2 by Mick Hansen

fix(Model#findAll): don't crash on subQuery and order: [.literal()]

1 parent 2b782f5e
Showing with 1 additions and 1 deletions
...@@ -1225,7 +1225,7 @@ module.exports = (function() { ...@@ -1225,7 +1225,7 @@ module.exports = (function() {
if (Array.isArray(options.order)) { if (Array.isArray(options.order)) {
options.order.forEach(function(t) { options.order.forEach(function(t) {
if (subQuery && !(t[0] instanceof Model) && !(t[0].model instanceof Model)) { if (subQuery && (Array.isArray(t) && !(t[0] instanceof Model) && !(t[0].model instanceof Model))) {
subQueryOrder.push(this.quote(t, model)); subQueryOrder.push(this.quote(t, model));
} }
mainQueryOrder.push(this.quote(t, model)); mainQueryOrder.push(this.quote(t, model));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!