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

Commit a7353fbf by Mick Hansen

[merge]

2 parents 2a8d31bb 97f840e3
......@@ -293,6 +293,9 @@ module.exports = (function() {
Object.defineProperties(this.DAO.prototype, attributeManipulation)
this.DAO.prototype.attributes = Object.keys(this.DAO.prototype.rawAttributes)
this.DAO.prototype._isAttribute = Utils._.memoize(function (key) {
return self.DAO.prototype.attributes.indexOf(key) !== -1
})
}
DAOFactory.prototype.sync = function(options) {
......
......@@ -157,8 +157,8 @@ module.exports = (function() {
this._setInclude(key, value, options)
return
} else {
// If not raw, and attribute is not in model definition
if (!options.raw && Object.keys(this.Model.attributes).indexOf(key) === -1) {
// If not raw, and attribute is not in model definition, return
if (!options.raw && !this._isAttribute(key)) {
return;
}
......
......@@ -282,7 +282,7 @@ describe(Support.getTestDialectTeaser("Include"), function () {
{title: 'Dress'},
{title: 'Bed'}
]).done(function () {
Product.findAll().done(callback)
Product.findAll({order: [ ['id'] ]}).done(callback)
})
},
tags: function(callback) {
......@@ -291,7 +291,7 @@ describe(Support.getTestDialectTeaser("Include"), function () {
{name: 'B'},
{name: 'C'}
]).done(function () {
Tag.findAll().done(callback)
Tag.findAll({order: [ ['id'] ]}).done(callback)
})
},
userProducts: ['user', 'products', function (callback, results) {
......@@ -317,7 +317,8 @@ describe(Support.getTestDialectTeaser("Include"), function () {
{model: Product, include: [
{model: Tag}
]}
]
],
order: [ ['id'], [Product, 'id'] ]
}).done(function (err, user) {
expect(err).not.to.be.ok
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!