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

Commit 78113233 by Mick Hansen

use the proper key

1 parent 65e36f7b
Showing with 6 additions and 7 deletions
......@@ -147,16 +147,15 @@ module.exports = (function() {
var opt = type + 'terMethods'
, funcs = Utils._.isObject(self.options[opt]) ? self.options[opt] : {}
Utils._.each(self.rawAttributes, function(attribute, name) {
if (attribute.hasOwnProperty(type)) {
funcs[name] = attribute[type]
} else if (typeof funcs[name] === "undefined") {
Utils._.each(self.rawAttributes, function(options, attribute) {
if (options.hasOwnProperty(type)) {
funcs[attribute] = options[type]
} else if (typeof funcs[attribute] === "undefined") {
if (type === 'get') {
funcs[name] = function() { return this.dataValues[attribute]; }
funcs[attribute] = function() { return this.dataValues[attribute]; }
}
if (type === 'set') {
funcs[name] = function(value) {
funcs[attribute] = function(value) {
if (Utils.hasChanged(this.dataValues[attribute], value)) {
//Only dirty the object if the change is not due to id, touchedAt, createdAt or updatedAt being initiated
var updatedAtAttr = Utils._.underscoredIf(this.__options.updatedAt, this.__options.underscored)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!