refactor cache

This commit is contained in:
alan 2016-03-25 16:26:33 +08:00
parent 46951f7af9
commit 3b48b3add7
1 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:course_activity => 0} %>
<% end %>
<% when 'News' %>
<% cache [act.id, act.comments.count] do %>
<% cache [act, act.comments.count] do %>
<%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
<% end %>
<% when 'Message'%>
@ -83,7 +83,7 @@
<% when 'Project' %>
<% case user_activity.act_type.to_s %>
<% when 'Issue' %>
<% cache [act.id, act.journals.count, act.attachments.count] do%>
<% cache [act, act.journals.count, act.attachments.count] do%>
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id, :user_id => user_id} %>
<% end %>
<% when 'Message' %>