From 3b48b3add75e3a59b14848a0a2d45703457363ee Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 25 Mar 2016 16:26:33 +0800 Subject: [PATCH] refactor cache --- app/views/users/_user_activities.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 63ae98280..26090d104 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -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' %>