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

Commit a7353fbf by Mick Hansen

[merge]

2 parents 2a8d31bb 97f840e3
...@@ -293,6 +293,9 @@ module.exports = (function() { ...@@ -293,6 +293,9 @@ module.exports = (function() {
Object.defineProperties(this.DAO.prototype, attributeManipulation) Object.defineProperties(this.DAO.prototype, attributeManipulation)
this.DAO.prototype.attributes = Object.keys(this.DAO.prototype.rawAttributes) 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) { DAOFactory.prototype.sync = function(options) {
......
...@@ -157,8 +157,8 @@ module.exports = (function() { ...@@ -157,8 +157,8 @@ module.exports = (function() {
this._setInclude(key, value, options) this._setInclude(key, value, options)
return return
} else { } else {
// If not raw, and attribute is not in model definition // If not raw, and attribute is not in model definition, return
if (!options.raw && Object.keys(this.Model.attributes).indexOf(key) === -1) { if (!options.raw && !this._isAttribute(key)) {
return; return;
} }
......
...@@ -282,7 +282,7 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -282,7 +282,7 @@ describe(Support.getTestDialectTeaser("Include"), function () {
{title: 'Dress'}, {title: 'Dress'},
{title: 'Bed'} {title: 'Bed'}
]).done(function () { ]).done(function () {
Product.findAll().done(callback) Product.findAll({order: [ ['id'] ]}).done(callback)
}) })
}, },
tags: function(callback) { tags: function(callback) {
...@@ -291,7 +291,7 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -291,7 +291,7 @@ describe(Support.getTestDialectTeaser("Include"), function () {
{name: 'B'}, {name: 'B'},
{name: 'C'} {name: 'C'}
]).done(function () { ]).done(function () {
Tag.findAll().done(callback) Tag.findAll({order: [ ['id'] ]}).done(callback)
}) })
}, },
userProducts: ['user', 'products', function (callback, results) { userProducts: ['user', 'products', function (callback, results) {
...@@ -317,7 +317,8 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -317,7 +317,8 @@ describe(Support.getTestDialectTeaser("Include"), function () {
{model: Product, include: [ {model: Product, include: [
{model: Tag} {model: Tag}
]} ]}
] ],
order: [ ['id'], [Product, 'id'] ]
}).done(function (err, user) { }).done(function (err, user) {
expect(err).not.to.be.ok 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!