Skip to content

Commit

Permalink
fix: a bug in findWithCache in mysql adapter with single option
Browse files Browse the repository at this point in the history
  • Loading branch information
XadillaX committed Oct 10, 2016
1 parent c028bf5 commit a1f411c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/adapters/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,11 @@ class MySQLAdapter extends Adapter {

options.fields = origFields;
const extraSql = self.makeSql("find", model, options);

if(options.single) {
return callback(err, liteResult.length ? liteResult[0] : null, extraSql);
}

return callback(err, liteResult, extraSql);
}
});
Expand Down

0 comments on commit a1f411c

Please sign in to comment.