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

Commit 97f840e3 by Mick Hansen

fix performance regression

1 parent 56fdc84c
Showing with 5 additions and 2 deletions
......@@ -294,6 +294,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) {
......
......@@ -162,8 +162,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;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!