Help with a complicated route / model fetch?

Hi all,

I’m having a hard time getting this to work, was hoping for some help! My app has:

Children:
  - has many RosterEntries
  - has many WaitListEntries

RosterEntry:
  - has one Program

WaitListEntry:
  - has one Program

Program:
  - has one Location

Location:
  - ID

A user of the app has favourite locations, and some children associated with their account.

What I’m trying to do is display a page that shows a list of favourite locations, and then for each favourite, shows for each child, whether they are rostered there or on the wait list.

Basically something like:


favourites.map( function(fav) {
  children.forEach( function(child) {
    if ( /* child is rostered at fav  */  ) {
      /*  set property on fav saying that child is rostered  */
    else if ( /* child is wait listed at fav  */ ) {
      /* set property on fav saying child is wait listed */
    }
  });
  return fav;
});

This requires that I get associations a few levels deep - e.g.:

children.getEach('rosterEntry.program.location.id') children.getEach('waitListEntry.program.location.id)

etc.

My route is getting insane with RSVP.hash and new RSVP.Promise. I feel like this is getting out of hand.

Any suggestions?

I ended up stumbling across this post. Win.