paperg/strider — pull request #11 by d3ming (2014-05-19 20:00:01+00:00)
Title: CD-126 Attempt to fix object is not a function error

When I make an unauthenticated API call for GET /api/job/:id, we get the following callstack:

TypeError: object is not a function
at Promise.gotRepo (/home/ubuntu/src/strider/routes/api/jobs.js:138:19)
at Promise. (/home/ubuntu/src/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:162:8)
at Promise.EventEmitter.emit (events.js:95:17)
at Promise.emit (/home/ubuntu/src/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:79:38)
at Promise.fulfill (/home/ubuntu/src/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:92:20)
at /home/ubuntu/src/strider/node_modules/mongoose/lib/query.js:1794:30
at /home/ubuntu/src/strider/node_modules/mongoose/lib/utils.js:414:16
at /home/ubuntu/src/strider/node_modules/mongoose/node_modules/mongodb/lib/mongodb/collection.js:953:5
at /home/ubuntu/src/strider/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:683:35
at Cursor.close (/home/ubuntu/src/strider/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:903:5)