lib/models/posts.js
function update(id, body, cb) {
  body.updated_at = new Date();

  var q = qb.update(id, body);
  db.getClient(function(err, client, done) {
    client.query(q[0], q[1], function(err, r) {
      var result = r && r.rows[0];
      if(!err && !result) { err = new exceptions.NotFound(); }
      if(err) {
        cb(err);
        done(err);
      } else {
        cb(null, result);
        done();
      }
    });
  });
}
function update(id, body, cb) {
  body.updated_at = new Date();

  var q = qb.update(id, body);
  db.getClient(function(err, client, done) {
    client.query(q[0], q[1], function(err, r) {
      var result = r && r.rows[0];
      if(!err && !result) { err = new exceptions.NotFound(); }
      if(err) {
        cb(err);
        done(err);
      } else {
        cb(null, result);
        done();
      }
    });
  });
}
function update ( id , body , cb ) { body . updated_at = new Date ( ) ; var q = qb . update ( id , body ) ; db . getClient ( function ( err , client , done ) { client . query ( q [ 0 ] , q [ 1 ] , function ( err , r ) { var result = r && r . rows [ 0 ] ; if ( ! err && ! result ) { err = new exceptions . NotFound ( ) ; } if ( err ) { cb ( err ) ; done ( err ) ; } else { cb ( null , result ) ; done ( ) ; } } ) ; } ) ; }
Updates post with `id`

`cb` is passed the updated post or exceptions.NotFound

@param {Number} id
@param {Object} body
@param {Function} cb
Updates post with id