fix removing from aspect -> contact removal bug

This commit is contained in:
danielgrippi 2011-03-30 10:44:25 -07:00
parent 86fe2db24e
commit 95578e79c6

View file

@ -9,13 +9,13 @@ class AspectMembershipsController < ApplicationController
def destroy
#note :id is garbage
@person_id = params[:person_id]
@aspect_id = params[:id]
@person_id = params[:person_id]
@aspect_id = params[:aspect_id]
@contact = current_user.contact_for(Person.where(:id => @person_id).first)
membership = @contact ? @contact.aspect_memberships.where(:aspect_id => @aspect_id).first : nil
@contact = current_user.contact_for(Person.where(:id => @person_id).first)
membership = @contact ? @contact.aspect_memberships.where(:aspect_id => @aspect_id).first : nil
if membership && membership.destroy
if membership && membership.destroy
flash.now[:notice] = I18n.t 'aspect_memberships.destroy.success'
respond_to do |format|