Created
December 11, 2014 20:03
-
-
Save forrestbthomas/576da44bd36fde13ec63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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