Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
forceUnload
Molecule.FeesMixin = Ember.Mixin.create
actions:
addFee: ->
trade = @get('content')
fee = @store.createRecord('fee', {
trade: trade,
name: "broker fee",
price: 5,
editing: true
})
removeFee: (fee) ->
fee.send('forceUnload')
forceUnload = (record) ->
record.clearRelationships()
record.transitionTo('deleted.saved')
DS.RootState.loaded.created.uncommitted.forceUnload = forceUnload
DS.RootState.loaded.updated.uncommitted.forceUnload = forceUnload
DS.RootState.loaded.saved.forceUnload = forceUnload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment