Skip to content

Instantly share code, notes, and snippets.

@forrestbthomas
Created December 11, 2014 20:03
Show Gist options
  • Save forrestbthomas/576da44bd36fde13ec63 to your computer and use it in GitHub Desktop.
Save forrestbthomas/576da44bd36fde13ec63 to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
// We are loading the groups where the current officer is a reviewer
var store = this.store;
return store.find('group-officer', {}).then(function(groups) {
var triggerStats = groups.map(function(group) {
return Ember.RSVP.all(group.get('group').get('topTriggers').map(function(topTrigger) {
return store.find('triggerStat', {
user_id: topTrigger.get('id')
});
}));
});
return Ember.RSVP.hash({
groups: groups,
seriesData: Ember.RSVP.all(triggerStats)
});
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment