defdestroyifcurrent_user.owned_projects.count>0redirect_toaccount_profile_path,alert: "Remove projects and groups before removing account."andreturnendcurrent_user.destroyrespond_todo|format|format.html{redirect_tonew_user_session_path,notice: "Account successfully removed."}endend