remove all mappings from a synapse on destroy in controller. Haven't added stuff to remove mappings to controller
This commit is contained in:
parent
c739f58b4b
commit
01fe14dbd1
1 changed files with 9 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue