缺陷更新区别新建

This commit is contained in:
huang 2015-08-25 13:51:42 +08:00
parent 4c974266b8
commit 90c199f15a
2 changed files with 4 additions and 8 deletions

View File

@ -145,18 +145,14 @@ class Issue < ActiveRecord::Base
def act_as_forge_message def act_as_forge_message
# 指派给自己的缺陷不提示消息 # 指派给自己的缺陷不提示消息
unless self.author_id == self.assigned_to_id unless self.author_id == self.assigned_to_id
self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, :project_id => self.project_id, :viewed => false)
:project_id => self.project_id,
:viewed => false)
end end
end end
# 更新缺陷 # 更新缺陷
def act_as_forge_message_update def act_as_forge_message_update
unless self.author_id == self.assigned_to_id unless self.author_id == self.assigned_to_id
self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, :project_id => self.project_id, :viewed => false, :update=> true)
:project_id => self.project_id,
:viewed => false)
end end
end end

View File

@ -133,11 +133,11 @@
<li class="homepageNewsPublisher fl"> <li class="homepageNewsPublisher fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %> <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
</li> </li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派问题给我</li> <li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">与我相关问题</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.forge_message.subject}" %></a> <%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.forge_message.subject}" %></a>
</li> </li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.updated_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ma.forge_message_type == "Journal" %> <% if ma.forge_message_type == "Journal" %>