* Last callers module WIP

This commit is contained in:
Bryan Ashby 2015-07-26 00:20:07 -06:00
parent 35a99b7e3e
commit 542327460b
7 changed files with 156 additions and 40 deletions

View file

@ -296,6 +296,18 @@ User.prototype.persist = function(useTransaction, cb) {
);
};
User.prototype.persistProperty = function(propName, propValue, cb) {
// update live props
this.properties[propName] = propValue;
userDb.run(
'REPLACE INTO user_property (user_id, prop_name, prop_value) ' +
'VALUES (?, ?, ?);', [ this.userId, propName, propValue ], function ran(err) {
cb(err);
}
);
}
User.prototype.persistProperties = function(cb) {
assert(this.userId > 0);