remove all mappings from a synapse on destroy in controller. Haven't added stuff to remove mappings to controller

This commit is contained in:
Devin Howard 2013-01-05 22:40:10 -05:00
parent c739f58b4b
commit 01fe14dbd1

View file

@ -116,11 +116,16 @@ class SynapsesController < ApplicationController
end
end
# DELETE synapses/:id
def destroy
@current = current_user
@synapse = Synapse.find(params[:id]).authorize_to_edit(@current)
@synapse.mappings.each do |m|
m.delete
end
@synapse.delete if @synapse
end
end