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

Commit ff6a3576 by Jan Aagaard Meier

Merge pull request #827 from joshm/findAndCountAll_attrs

Find and count all attrs needs attributes reset
2 parents 6a9c8509 4c441e0a
Showing with 13 additions and 2 deletions
...@@ -356,11 +356,12 @@ module.exports = (function() { ...@@ -356,11 +356,12 @@ module.exports = (function() {
var self = this var self = this
, opts = Utils._.cloneDeep(options) , opts = Utils._.cloneDeep(options)
, copts = Utils._.extend({}, Utils._.cloneDeep(options) || {}, { , copts = Utils._.extend({}, Utils._.cloneDeep(options) || {}, {
// no limit, offset, order or include for the options given to count() // no limit, offset, order, attributes or include for the options given to count()
offset : 0, offset : 0,
limit : 0, limit : 0,
order : null, order : null,
include : null include : null,
attributes: []
}) })
return new Utils.CustomEventEmitter(function (emitter) { return new Utils.CustomEventEmitter(function (emitter) {
......
...@@ -2231,6 +2231,16 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -2231,6 +2231,16 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
done() done()
}) })
}) })
it("handles attributes", function(done) {
this.User.findAndCountAll({where: "id != " + this.users[0].id, attributes: ['data']}).success(function(info) {
expect(info.count).to.equal(2)
expect(Array.isArray(info.rows)).to.be.ok
expect(info.rows.length).to.equal(2)
expect(info.rows[0].selectedValues).to.not.have.property('username')
expect(info.rows[1].selectedValues).to.not.have.property('username')
done()
})
})
}) })
describe('all', function() { describe('all', function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!