add avatarUrl propertuy to user model

This commit is contained in:
Lisa P 2016-01-26 18:40:03 +01:00
parent d82ff49359
commit 5d74d57ac6
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,4 @@
import Ember from 'ember';
import config from 'travis/config/environment';
import {gravatarImage} from '../utils/urls';
export default Ember.Component.extend({

View File

@ -3,6 +3,7 @@ import Model from 'travis/models/model';
import config from 'travis/config/environment';
import attr from 'ember-data/attr';
import { hasMany, belongsTo } from 'ember-data/relationships';
import {gravatarImage} from '../utils/urls';
export default Model.extend({
ajax: Ember.inject.service(),
@ -132,5 +133,9 @@ export default Model.extend({
user = JSON.parse(this.get('sessionStorage').getItem('travis.user'));
user[name.underscore()] = this.get(name);
return this.get('sessionStorage').setItem('travis.user', JSON.stringify(user));
}
},
avatarUrl: function() {
return gravatarImage(this.get('email'), 36);
}.property()
});