travis-web/app/serializers/commit.js
2015-12-10 09:39:05 +01:00

17 lines
627 B
JavaScript

import Ember from 'ember';
import V2FallbackSerializer from 'travis/serializers/v2_fallback';
export default V2FallbackSerializer.extend({
normalize(modelClass, resourceHash) {
if(resourceHash.author && resourceHash.author.name) {
resourceHash.author_name = resourceHash.author.name;
resourceHash.author_avatar_url = resourceHash.author.avatar_url;
}
if(resourceHash.committer && resourceHash.committer.name) {
resourceHash.committer_name = resourceHash.author.name;
resourceHash.committer_avatar_url = resourceHash.author.avatar_url;
}
return this._super(...arguments);
}
});