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

Commit 1b7aec39 by Jan Aagaard Meier

Merge pull request #899 from hackwaly/master

fix the bug `findAndCountAll` not working on postgresql.
2 parents a8ce9570 5da0c239
Showing with 10 additions and 1 deletions
......@@ -55,7 +55,7 @@ var Utils = module.exports = {
},
format: function(arr, dialect) {
var timeZone = null;
return SqlString.format(arr.shift(), arr, timeZone, dialect)
return SqlString.format(arr[0], arr.slice(1), timeZone, dialect)
},
formatNamedParameters: function(sql, parameters, dialect) {
var timeZone = null;
......
......@@ -2752,6 +2752,15 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
it('does not modify the passed arguments', function (done) {
var options = { where: ['username = ?', 'user1']}
this.User.count(options).success(function(count) {
expect(options).to.deep.equal({ where: ['username = ?', 'user1']})
done()
})
})
it('allows sql logging', function(done) {
this.User.count().on('sql', function(sql) {
expect(sql).to.exist
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!