How to call items on RSVP hash result?

Setting multipel models in a single route involves using RSVP.hash, which returns a recordarray object.

I can’t seem to grab a single record out of it.

  model: (params) ->
      modelActive: this.modelFor('personalities').findBy('type', this.paramsFor('personalities').activeType)
      modelOther:  this.modelFor('personalities').findBy('type', params.otherType)

In the controller, let’s say I try to access one model to do some presentation logic (e.g. uppercase-ing).


This is an array of objects. Let’s say I want one. this doesn’t repond to any of the methods .find .findBy .filter .then . It does respond to .get(‘firstObject’) but I obviously want to access other objects in the recordarray, not just the first one.

what’s the proper syntax to extract one record out of a recordarray?

I think you’re looking for EmberArray - 4.6 - Ember API Documentation

Hm. I wonder if that can be used to find records based on other attributes of the record, or even the id, rather than just the index.

The return value of RSVP hash is a RecordArray which is a subclass of ArrayProxy, which has all the usual findBy methods… so I don’t understand why find, and findBy aren’t working.