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

Commit 97e063d2 by Jochem Maas

change use of doa.value property to using doa.dataValues

1 parent 2eb96be5
Showing with 5 additions and 5 deletions
......@@ -396,7 +396,7 @@ module.exports = (function() {
daos.forEach(function(dao) {
var values = {};
fields.forEach(function(field) {
values[field] = dao.values[field]
values[field] = dao.dataValues[field]
})
if (self.options.timestamps) {
values[updatedAtAttr] = Utils.now()
......@@ -406,7 +406,7 @@ module.exports = (function() {
} else {
daos.forEach(function(dao) {
records.push(dao.values)
records.push(dao.dataValues)
})
}
......
......@@ -93,7 +93,7 @@ module.exports = (function() {
// only those fields will be updated
DAO.prototype.save = function(fields) {
var self = this
, values = fields ? {} : this.values
, values = fields ? {} : this.dataValues
, updatedAtAttr = this.__options.underscored ? 'updated_at' : 'updatedAt'
, createdAtAttr = this.__options.underscored ? 'created_at' : 'createdAt'
......@@ -108,7 +108,7 @@ module.exports = (function() {
}
}
var tmpVals = self.values
var tmpVals = self.dataValues
fields.forEach(function(field) {
if (tmpVals[field] !== undefined) {
......@@ -279,7 +279,7 @@ module.exports = (function() {
DAO.prototype.equals = function(other) {
var result = true
Utils._.each(this.values, function(value, key) {
Utils._.each(this.dataValues, function(value, key) {
if(Utils._.isDate(value) && Utils._.isDate(other[key])) {
result = result && (value.getTime() == other[key].getTime())
} else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!