Skip to content

Commit

Permalink
mysql fix fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
mideveloper committed May 8, 2014
1 parent 6ada567 commit b9b0ec8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/models/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,17 @@ function initialize(params) {
return _knex(self.tableName).where(self.input).select(_.toArray(arguments)).then(function(obj) {
if (obj.length > 0) {
return self.getObjectFromDBObject(obj.shift());
}else{
return null;
}
});
}
else {
return _knex(self.tableName).where(self.input).select().then(function(obj) {
if (obj.length > 0) {
return self.getObjectFromDBObject(obj.shift());
}else{
return null;
}
});
}
Expand Down

0 comments on commit b9b0ec8

Please sign in to comment.