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

Commit e1dbc3a4 by Jochem Maas

also drop "order" property for options passed to count() when using findAndCount()

1 parent 596d78f3
...@@ -256,6 +256,7 @@ module.exports = (function() { ...@@ -256,6 +256,7 @@ module.exports = (function() {
// no limit or offset for the options given to count() // no limit or offset for the options given to count()
copts.offset = 0; copts.offset = 0;
copts.limit = 0; copts.limit = 0;
copts.order = null;
return new Utils.CustomEventEmitter(function (emitter) { return new Utils.CustomEventEmitter(function (emitter) {
var emit = { var emit = {
......
...@@ -247,6 +247,17 @@ describe('DAOFactory', function() { ...@@ -247,6 +247,17 @@ describe('DAOFactory', function() {
}) })
}) })
it("handles where clause with ordering [only]", function() {
Helpers.async(function(done) {
User.findAndCount({where: "id != " + users[0].id, order: 'id ASC'}).success(function(info) {
expect(info.count).toEqual(fullcount - 1)
expect(Array.isArray(info.rows)).toBeTruthy()
expect(info.rows.length).toEqual(fullcount - 1)
done()
})
})
})
/* /*
// at time of writing (v1.6.0) Sequelize does not seem to support 'offset' on it's own consistently (goes wrong for PostGRES and SQLite) // at time of writing (v1.6.0) Sequelize does not seem to support 'offset' on it's own consistently (goes wrong for PostGRES and SQLite)
it("handles offset", function() { it("handles offset", function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!