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

Commit 74f2c95d by Nazar Aziz

split updateAttributes into setAttributes and updateAttributes where the latter saves given updates

1 parent 38135327
Showing with 5 additions and 2 deletions
...@@ -164,6 +164,11 @@ module.exports = (function() { ...@@ -164,6 +164,11 @@ module.exports = (function() {
DAO.prototype.updateAttributes = function(updates) { DAO.prototype.updateAttributes = function(updates) {
this.setAttributes(updates)
return this.save()
}
DAO.prototype.setAttributes = function(updates) {
var self = this var self = this
var readOnlyAttributes = Utils._.keys(this.__factory.primaryKeys) var readOnlyAttributes = Utils._.keys(this.__factory.primaryKeys)
...@@ -180,8 +185,6 @@ module.exports = (function() { ...@@ -180,8 +185,6 @@ module.exports = (function() {
) )
updateAllowed && (self[attr] = value) updateAllowed && (self[attr] = value)
}) })
return this.save()
} }
DAO.prototype.destroy = function() { DAO.prototype.destroy = function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!