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

Commit 473bce05 by sdepold

differentiate between normal defaultValues and NOW

1 parent 8921b137
......@@ -165,7 +165,7 @@ module.exports = (function() {
var value = null
if(self.rawAttributes.hasOwnProperty(name) && self.rawAttributes[name].hasOwnProperty('defaultValue')) {
value = self.rawAttributes[name].defaultValue
value = Utils.toDefaultValue(self.rawAttributes[name].defaultValue)
}
instance[name] = value
......
......@@ -249,8 +249,9 @@ module.exports = (function() {
}
Utils._.map(defaults, function(value, attr) {
if(!self.hasOwnProperty(attr))
self.addAttribute(attr, value)
if(!self.hasOwnProperty(attr)) {
self.addAttribute(attr, Utils.toDefaultValue(value))
}
})
}
......
......@@ -4,5 +4,6 @@ module.exports = {
INTEGER: 'INTEGER',
DATE: 'DATETIME',
BOOLEAN: 'TINYINT(1)',
FLOAT: 'FLOAT'
FLOAT: 'FLOAT',
NOW: 'NOW'
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!