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

Commit f189cf27 by Mick Hansen

findAll optClone should not fuck with .col/.literal/.fn/.cast - fixes #1249

1 parent 751da171
......@@ -1426,7 +1426,14 @@ module.exports = (function() {
var optClone = function (options) {
return Utils._.cloneDeep(options, function (elem) {
// The DAOFactories used for include are pass by ref, so don't clone them. Otherwise return undefined, meaning, 'handle this lodash'
return elem instanceof DAOFactory ? elem : undefined
if (elem instanceof DAOFactory) {
return elem
}
if (elem instanceof Utils.col || elem instanceof Utils.literal || elem instanceof Utils.cast || elem instanceof Utils.fn) {
return elem
}
return undefined
})
}
......
......@@ -857,6 +857,22 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
})
it.only('should be possible to order by sequelize.col()', function (done) {
var self = this
var Company = this.sequelize.define('Company', {
name: Sequelize.STRING
});
Company.sync().done(function () {
Company.findAll({
order: [self.sequelize.col('name')]
}).done(function(err) {
expect(err).not.to.be.ok
done()
})
})
})
})
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!