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

Commit a9d473d9 by Jan Aagaard Meier

Merge pull request #5249 from rmzg/master

Updated the fix for user defined attributes overwriting builtins.
2 parents aa099574 719701bd
Showing with 1 additions and 3 deletions
......@@ -196,10 +196,8 @@ Instance.prototype.get = function(key, options) { // testhint options:none
return this.dataValues[key];
}
}
if (this.dataValues) {
return this.dataValues[key];
}
}
if (this._hasCustomGetters || (options && options.plain && this.$options.include) || (options && options.clone)) {
var values = {}
......
......@@ -925,7 +925,7 @@ Model.prototype.refreshAttributes = function() {
this.Instance.prototype._hasCustomSetters = Object.keys(this.Instance.prototype._customSetters).length;
Object.keys(attributeManipulation).forEach((function(key){
if (this.Instance.prototype[key] !== undefined) {
if (Instance.prototype.hasOwnProperty(key)) {
this.sequelize.log("Not overriding built-in method from model attribute: " + key);
return;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!