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

Commit 4843dee2 by Jochem Maas

remove bogus sanity check - when adding an attribute (i.e. defining the data pro…

…perty in terms of getters and setters, we should not care about whether the relevant underlying dataValue is already set or not - previously added/initialized properties may have setters that set the dataValue of the attribute currently being added/initialized (e.g. the setter of a "name" property that also sets the dataValue for the "slug" property, when the "slug" property is defined after the "name" property, in the model,and the bogus sanity check in place the "slug" property does not get its setters/getters defined ... thereby breaking the model!)
1 parent 0af885ec
Showing with 0 additions and 4 deletions
......@@ -300,10 +300,6 @@ module.exports = (function() {
}
DAO.prototype.addAttribute = function(attribute, value) {
if (typeof this.dataValues[attribute] !== 'undefined') {
return
}
if (this.booleanValues.length && this.booleanValues.indexOf(attribute) !== -1 && value !== undefined) { // transform integer 0,1 into boolean
value = !!value
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!