Merge pull request #3490 from jaswilli/psm

Fix for missing author when switching posts
This commit is contained in:
Hannah Wolfe 2014-07-31 22:38:09 +01:00
commit f5f4a4e152

View File

@ -32,10 +32,17 @@ var PostSettingsMenuController = Ember.ObjectController.extend({
}.observes('selectedAuthor'),
authors: function () {
//Loaded asynchronously, so must use promise proxies.
var deferred = {};
var deferred = {},
self = this;
deferred.promise = this.store.find('user').then(function (users) {
return users.rejectBy('id', 'me');
}).then(function (users) {
self.set('selectedAuthor', users.get('firstObject'));
return users;
});
return Ember.ArrayProxy
.extend(Ember.PromiseProxyMixin)
.create(deferred);