From 07ff420a6a69e073ce66f778de270ec1c52f5374 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 29 Jul 2016 23:23:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=87=BA=E9=A1=B9=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E6=B8=85=E6=A5=9A=E7=94=B3=E8=AF=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f135c8ab2..5dcf493ee 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -792,6 +792,11 @@ class ProjectsController < ApplicationController members = Member.where(:user_id => User.current.id, :project_id=>params[:id]).first if members != nil && members.roles.first.to_s != "Manager" members.destroy + # 移出的时候删除申请消息,不需要删除消息,所以不必要关联删除 + applied_projects = AppliedProject.where(:project_id => @project.id, :user_id => members.user_id).first + unless applied_projects.nil? + applied_projects.delete + end end respond_to do |format| format.js