Sideload strains in species list

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

View file

@ -7,7 +7,7 @@ export default DS.Model.extend({
typeSpecies : DS.attr('boolean'), typeSpecies : DS.attr('boolean'),
etymology : DS.attr('string'), etymology : DS.attr('string'),
genusName : DS.attr('string', { defaultValue: config.APP.genus }), genusName : DS.attr('string', { defaultValue: config.APP.genus }),
strains : DS.hasMany('strain', { async: true }), strains : DS.hasMany('strain', { async: false }),
totalStrains: DS.attr('number'), totalStrains: DS.attr('number'),
createdAt : DS.attr('date'), createdAt : DS.attr('date'),
updatedAt : DS.attr('date'), updatedAt : DS.attr('date'),

View file

@ -3,7 +3,7 @@ import Ember from 'ember';
export default DS.Model.extend({ export default DS.Model.extend({
measurements : DS.hasMany('measurements', { async: true }), measurements : DS.hasMany('measurements', { async: true }),
species : DS.belongsTo('species', { async: true }), species : DS.belongsTo('species', { async: false }),
strainName : DS.attr('string'), strainName : DS.attr('string'),
typeStrain : DS.attr('boolean'), typeStrain : DS.attr('boolean'),
accessionNumbers : DS.attr('string'), accessionNumbers : DS.attr('string'),

View file

@ -2,7 +2,7 @@ import Ember from 'ember';
export default Ember.Controller.extend({ export default Ember.Controller.extend({
sortParams: ['speciesName', 'strainCount'], sortParams: ['speciesName', 'strainCount'],
sortedSpecies: Ember.computed.sort('species', 'sortParams'), sortedSpecies: Ember.computed.sort('model', 'sortParams'),
metaData: function() { metaData: function() {
return this.store.metadataFor('species'); 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, { export default Ember.Route.extend(AuthenticatedRouteMixin, {
model: function() { model: function() {
return Ember.RSVP.hash({ return this.store.findAll('species');
species: this.store.findAll('species'), }
strains: this.store.findAll('strain'),
});
},
setupController: function(controller, models) {
controller.setProperties(models);
},
}); });