DS.ManyArray Class packages/ember-data/lib/system/record_arrays/many_array.js:10


A ManyArray is a RecordArray that represents the contents of a has-many relationship.

The ManyArray is instantiated lazily the first time the relationship is requested.

Inverses

Often, the relationships in Ember Data applications will have an inverse. For example, imagine the following models are defined:

1
2
3
4
5
6
7
App.Post = DS.Model.extend({
  comments: DS.hasMany('comment')
});

App.Comment = DS.Model.extend({
  post: DS.belongsTo('post')
});

If you created a new instance of App.Post and added a App.Comment record to its comments has-many relationship, you would expect the comment's post property to be set to the post that contained the has-many.

We call the record to which a relationship belongs the relationship's owner.

Show:

Properties

Show:

Ember.RSVP.Promise private

Used for async hasMany arrays to keep track of when they will resolve.

type

DS.Model

The model type contained by this record array.