if (typeof $ === "undefined") { throw new Error("jQuery is required") } Record.User = function(args) { var superArguments = Array.prototype.slice.call(arguments); superArguments.unshift("user"); Record.Generic.apply(this, superArguments); } Record.User.prototype = Object.create(Record.Generic.prototype); Record.User.prototype.constructor = Record.User; Record.User.prototype.fetch = function(callback) { var self = this; var id = this.id; async.parallel([ this.attributes.bind(this), this.ownedResources.bind(this) ], function(err, results) { if ( err ) return errback(err); callback({user: results[0], owned: results[1]}); }); }