travis-web/app/adapters/repo.js
Piotr Sarnacki 47439657a1 Use lastBuild from defaultBranch on repository
One thing that is not standard here is a serializer for branch, which
uses @href as id. At this point branches don't have ids and ember-data
needs one, so using @href is the easiest way.
2015-12-08 10:18:02 +01:00

25 lines
588 B
JavaScript

import V3Adapter from 'travis/adapters/v3';
export default V3Adapter.extend({
buildUrl(modelName, id, snapshot, requestType, query) {
var url = this._super(...arguments);
return url;
},
ajaxOptions(url, type, options) {
var hash = options || {};
if(!hash.data) {
hash.data = {};
}
if(hash.data.include) {
hash.data.include += ',repository.default_branch,branch.last_build,build.commit';
} else {
hash.data.include = 'repository.default_branch,branch.last_build,build.commit';
}
return this._super(url, type, hash);
}
});