workaround for duplicated records after save

adding reload after save as workaround for bug: duplicated records after save
causing unnecessary GET requests
This commit is contained in:
jelhan 2014-02-22 03:28:49 +01:00
parent bdf620d092
commit c39021dee5

View file

@ -297,9 +297,12 @@ App.CreateSettingsController = Ember.ObjectController.extend({
// save poll
var self = this;
this.get('model').save().then(function(model){
// reload as workaround for bug: duplicated records after save
model.reload().then(function(model){
// redirect to new poll
self.transitionToRoute('poll', model, {queryParams: {encryptionKey: self.get('encryption.key')}});
});
});
}
}
});
@ -343,6 +346,8 @@ App.PollController = Ember.ObjectController.extend({
// assign new user to poll
users.pushObject(newUser);
});
// reload as workaround for bug: duplicated records after save
self.get('model').reload();
});
});
}