From 3313b6e5f9c04c1d0512b7c24bb0af69dd44aaf6 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 2 Dec 2015 11:43:58 -0700 Subject: [PATCH] Don't unload user models on delete --- app/mixins/delete-model.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/mixins/delete-model.js b/app/mixins/delete-model.js index 73f6ec5..9e113a0 100644 --- a/app/mixins/delete-model.js +++ b/app/mixins/delete-model.js @@ -8,7 +8,10 @@ export default Mixin.create({ actions: { delete: function() { this.get('model').destroyRecord().then(() => { - this.get('store').unloadAll(); + // Instead of unloading the entire store, we keep the loaded user models + ['species', 'strain', 'characteristic', 'measurement'].map((model) => { + this.get('store').unloadAll(model); + }); this.transitionToRoute(this.get('transitionRoute')); }); },