Fix no order exists bug

This commit is contained in:
loay 2017-03-14 21:54:03 -04:00
parent 8f2cb3ae7a
commit 1e19c1465a
1 changed files with 2 additions and 1 deletions

View File

@ -1159,8 +1159,9 @@ SQLConnector.prototype._buildWhere = function(model, where) {
* @returns {string} The ORDER BY clause
*/
SQLConnector.prototype.buildOrderBy = function(model, order) {
var idName = this.idName(model);
if (!order) {
return '';
order = idName;
}
var self = this;
if (typeof order === 'string') {