Let's assume there are such routes:
@resource 'group', path: '/group/:group_id', ->
@route 'tweets'
Now I have these paths and controllers:
- group - here I have model loaded by its id
- group.index - here I use that model
- group.tweets - here I need to load some additional collection that depends on group.id
Naive way to do so (which is not working) in GroupTweetsRoute:
model: ->
@store.find 'tweet',
group_id: @get('controllers.group.id')
tolerance: @get('controllers.group.membership.tolerance')
I tried controllerFor as well. So at the moment I have no group there. But I see it later or if I get there from the group.index page.
My guess is that there is some async promise-based stuff I can do in beforeModel callback to wait until group is loaded. But what exactly?