From fce872a6a513a78eee063a2925db92e117f9c08b Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Oct 2015 17:42:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96issue=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 2232602aa..923414583 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -113,12 +113,8 @@ class IssuesController < ApplicationController def show # 当前用户查看指派给他的缺陷消息,则设置消息为已读 - query = @issue.forge_messages - query.each do |m| - if m.user_id == User.current.id - m.update_attribute(:viewed, true) - end - end + query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first + query.update_attribute(:viewed, true) unless query.nil? # 缺陷状态更新 query_journals = @issue.journals query_journals.each do |query_journal|