cache user promotion report

This commit is contained in:
r888888888
2013-06-21 16:52:59 -07:00
parent cb469a75bf
commit ef2faff245
2 changed files with 13 additions and 9 deletions

View File

@@ -15,14 +15,16 @@
</tr>
</thead>
<tbody>
<% @report.users.each do |user| %>
<tr>
<td><%= link_to user.name, user_path(user) %></td>
<td><%= user.level_string %></td>
<td><%= number_to_percentage Reports::UserPromotions.confidence_interval_for(user, 1), :precision => 0 %></td>
<td><%= number_to_percentage Reports::UserPromotions.confidence_interval_for(user, 5), :precision => 0 %></td>
<td><%= number_to_percentage Reports::UserPromotions.confidence_interval_for(user, 10), :precision => 0 %></td>
</tr>
<% cache("user-promotions-report/#{Date.today}") do %>
<% @report.users.each do |user| %>
<tr>
<td><%= link_to user.name, user_path(user) %></td>
<td><%= user.level_string %></td>
<td><%= number_to_percentage Reports::UserPromotions.confidence_interval_for(user, 1), :precision => 0 %></td>
<td><%= number_to_percentage Reports::UserPromotions.confidence_interval_for(user, 5), :precision => 0 %></td>
<td><%= number_to_percentage Reports::UserPromotions.confidence_interval_for(user, 10), :precision => 0 %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>