/**
 * @fileOverview
 * @name files.js
 * @author V. Glenn Tarcea <glenn.tarcea@gmail.com>
 * @license
 */

module.exports = function(r) {
    'use strict';
    return {
        countInProject: countInProject
    };

    function *countInProject(ids, projectID) {
        let rql = r.table('datafiles').getAll.apply(this, ids);
        let count = yield rql.filter({project_id: projectID}).count();
        return count;
    }
};

@@ -306,25 +306,21 @@
 tAll
-.apply(this, 
+(r.args(
 ids)
+)
 ;%0A  

Update how we call getAll to properly parse out an array of keys using r.args() rather than doing getAll.apply(this, items) (which doesn't work).