Sideload strains in species list
This commit is contained in:
parent
3db54ea933
commit
3b17955c0d
4 changed files with 5 additions and 12 deletions
|
@ -7,7 +7,7 @@ export default DS.Model.extend({
|
|||
typeSpecies : DS.attr('boolean'),
|
||||
etymology : DS.attr('string'),
|
||||
genusName : DS.attr('string', { defaultValue: config.APP.genus }),
|
||||
strains : DS.hasMany('strain', { async: true }),
|
||||
strains : DS.hasMany('strain', { async: false }),
|
||||
totalStrains: DS.attr('number'),
|
||||
createdAt : DS.attr('date'),
|
||||
updatedAt : DS.attr('date'),
|
||||
|
|
|
@ -3,7 +3,7 @@ import Ember from 'ember';
|
|||
|
||||
export default DS.Model.extend({
|
||||
measurements : DS.hasMany('measurements', { async: true }),
|
||||
species : DS.belongsTo('species', { async: true }),
|
||||
species : DS.belongsTo('species', { async: false }),
|
||||
strainName : DS.attr('string'),
|
||||
typeStrain : DS.attr('boolean'),
|
||||
accessionNumbers : DS.attr('string'),
|
||||
|
|
|
@ -2,7 +2,7 @@ import Ember from 'ember';
|
|||
|
||||
export default Ember.Controller.extend({
|
||||
sortParams: ['speciesName', 'strainCount'],
|
||||
sortedSpecies: Ember.computed.sort('species', 'sortParams'),
|
||||
sortedSpecies: Ember.computed.sort('model', 'sortParams'),
|
||||
|
||||
metaData: function() {
|
||||
return this.store.metadataFor('species');
|
||||
|
|
|
@ -3,13 +3,6 @@ import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixi
|
|||
|
||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||
model: function() {
|
||||
return Ember.RSVP.hash({
|
||||
species: this.store.findAll('species'),
|
||||
strains: this.store.findAll('strain'),
|
||||
});
|
||||
},
|
||||
|
||||
setupController: function(controller, models) {
|
||||
controller.setProperties(models);
|
||||
},
|
||||
return this.store.findAll('species');
|
||||
}
|
||||
});
|
||||
|
|
Reference in a new issue