Cross posted from https://github.com/emberjs/ember.js/issues/5043
Am I missing something fundamental here or should this work?
var Foo = Ember.Object.extend({
friends: function() {
console.log('friends');
return this.get('groups').reduce(function(acc, group) {
return acc.concat(group.get('accounts.content'));
}, []);
}.property('groups.@each.accounts.[]'),
foo: function() {
console.log('foo');
}.observes('groups.@each.accounts.[]')
});
window.foo = Foo.create({
groups: Ember.A([
Ember.Object.create({
accounts: Ember.A(['foo', 'bar', 'baz'])
})
])
});
foo.get('friends');
foo.get('groups')[0].get('accounts').pushObject('asdf');