Sideload strains in species list

This commit is contained in:
Matthew Dillon 2015-07-07 11:09:41 -08:00
parent ae7f3bdafa
commit 38894d94e7
4 changed files with 5 additions and 12 deletions

View file

@ -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'),

View file

@ -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'),

View file

@ -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');

View file

@ -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');
}
});