Ember.ArrayProxy.prototype.flatten = Array.prototype.flatten = function() {
var r = [];
this.forEach(function(el) {
r.push.apply(r, Ember.isArray(el) ? el.flatten() : [el]);
});
return r;
}
If you wanted to get all the books of all the authors in your library.
App.Author = DS.Model.extend
books: DS.hasMany(App.book)
App.Book = DS.Model.extend()
App.Author.find().mapProperty('books').flatten()
will return all books in an instance of a plain Array.