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'),
|
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'),
|
||||||
|
|
|
@ -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'),
|
||||||
|
|
|
@ -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');
|
||||||
|
|
|
@ -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);
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue