lib/models/tags.js
function all(options, cb) {
  var q
    , page = Number(options.page) || 1
    , limit = Number(options.limit) || conf.objects_by_page
    , offset = (page - 1) * limit;

  count(function(err, count) {
    if(err) { return cb(err); }

    q = select('LEFT JOIN');
    q += ' LIMIT ' + limit + ' OFFSET ' + offset;

    db.getClient(function(err, client, done) {
      client.query(q, function(err, r) {
        if(err) {
          cb(err);
          done(err);
        } else {
          cb(null, {
            rows: r.rows,
            count: count,
            limit: limit,
            offset: offset,
            page: page
          });
          done();
        }
      });
    });
  });
}
function all(options, cb) {
  var q
    , page = Number(options.page) || 1
    , limit = Number(options.limit) || conf.objects_by_page
    , offset = (page - 1) * limit;

  count(function(err, count) {
    if(err) { return cb(err); }

    q = select('LEFT JOIN');
    q += ' LIMIT ' + limit + ' OFFSET ' + offset;

    db.getClient(function(err, client, done) {
      client.query(q, function(err, r) {
        if(err) {
          cb(err);
          done(err);
        } else {
          cb(null, {
            rows: r.rows,
            count: count,
            limit: limit,
            offset: offset,
            page: page
          });
          done();
        }
      });
    });
  });
}
function all ( options , cb ) { var q , page = Number ( options . page ) || 1 , limit = Number ( options . limit ) || conf . objects_by_page , offset = ( page - 1 ) * limit ; count ( function ( err , count ) { if ( err ) { return cb ( err ) ; } q = select ( 'LEFT JOIN' ) ; q += ' LIMIT ' + limit + ' OFFSET ' + offset ; db . getClient ( function ( err , client , done ) { client . query ( q , function ( err , r ) { if ( err ) { cb ( err ) ; done ( err ) ; } else { cb ( null , { rows : r . rows , count : count , limit : limit , offset : offset , page : page } ) ; done ( ) ; } } ) ; } ) ; } ) ; }
Finds all tags

@param {Object} options
@param {Function} cb
Finds all tags