I have some models set up with async relationships, e.g.:
User = DS.Model({
postsApproved: DS.hasMany('post', {async: true, inverse: 'approved'})
})
Post = DS.Model({
approver: DS.belongsTo('user', {async: true, inverse: 'postsApproved'})
})
In a controller, I have a property on the post, isApproved
, which simply checks if approver
is set. I expect that this should work:
isApproved: function() {
return !Ember.isNone(this.get('approver'));
}
But that always returns true, and if I inspect the data I see that it is because this.get('approver')
returns a promise. This works:
isApproved: function() {
return !Ember.isNone(this.get('approver.content'));
}
But using content
seems to me to be messing around with the internals a bit too much. Is this the right way to do it, or am I missing something?