app/controllers/registrations_controller.rb
# destroy all user's jobs if their account is deleted
destroy all user's jobs if their account is deleted
destroy all user ' s jobs if their account is deleted
def destroy
    jobs = Job.all(:email => current_user.email)
    jobs.each do |j|
      j.destroy
    end
    current_user.destroy
    respond_to do |format|
      format.html { redirect_to :controller => 'jobs', :action => 'index' }
      format.json { head :ok }
    end
  end
def destroy jobs = Job . all ( :email => current_user . email ) jobs . each do | j | j . destroy end current_user . destroy respond_to do | format | format . html { redirect_to :controller => 'jobs' , :action => 'index' } format . json { head :ok } end end
destroy all user's jobs if their account is deleted
destroy all user ' s jobs if their account is deleted
# first find the users and set their accounts back to default # now the account may be safely destroyed