Don't inject kredits service in models

This commit is contained in:
2018-04-16 19:23:28 +02:00
parent ba3c707da3
commit c0b5c36115
4 changed files with 24 additions and 36 deletions
-10
View File
@@ -1,12 +1,8 @@
import EmberObject from '@ember/object';
import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';
import { inject as injectService } from '@ember/service';
import bignumber from 'kredits-web/utils/cps/bignumber';
export default EmberObject.extend({
kredits: injectService(),
// Contract
id: bignumber('idRaw', 'toString'),
creatorAccount: null,
@@ -26,10 +22,4 @@ export default EmberObject.extend({
details: {},
url: null,
ipfsData: '',
// Relationships
// TODO: Optimize it. We don't need to find the contributor every time we add a new one
contributor: computed('contributorId', 'kredits.contributors.[]', function() {
return this.get('kredits.contributors').findBy('id', this.contributorId);
})
});