From af136e75ca77e0ec3c4dfb343102ba549e4918ae Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Tue, 19 Mar 2013 18:07:46 -0400 Subject: [PATCH] Fix bug 249 the ugly way (decerebrate the moronically impotent model) --- cms/static/coffee/src/views/unit.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cms/static/coffee/src/views/unit.coffee b/cms/static/coffee/src/views/unit.coffee index 7f5fa4adce..3bf049d31b 100644 --- a/cms/static/coffee/src/views/unit.coffee +++ b/cms/static/coffee/src/views/unit.coffee @@ -109,7 +109,14 @@ class CMS.Views.UnitEdit extends Backbone.View id: $component.data('id') }, => $component.remove() - @model.save(children: @components()) + # b/c we don't vigilantly keep children up to date + # get rid of it before it hurts someone + # sorry for the js, i couldn't figure out the coffee equivalent + `_this.model.save({children: _this.components()}, + {success: function(model) { + model.unset('children'); + }} + );` ) deleteDraft: (event) ->