I have some models configured with asynchronous relationships, for example:
User = DS.Model({ postsApproved: DS.hasMany('post', {async: true, inverse: 'approved'}) }) Post = DS.Model({ approver: DS.belongsTo('user', {async: true, inverse: 'postsApproved'}) })
In the controller, I have a property in the message, isApproved , which simply checks if approver is approver . I expect this to work:
isApproved: function() { return !Ember.isNone(this.get('approver')); }
But this always returns true, and if I check the data, I see that this is because this.get('approver') returns a promise. It works:
isApproved: function() { return !Ember.isNone(this.get('approver.content')); }
But using content seems to me too messing around with internal elements. Is this the right way to do this, or am I missing something?
source share