Commit cffa7e173b95edecad14576823c42048fa84ae9b

Authored by Guilherme Rojas V. de Lima
Committed by Rafael Manzo
1 parent 490117c2

Caching to metric and module results.

Missing cache to graphics.

Signed off by: Rafael Reggiani Manzo <rr.manzo@gmail.com>
app/views/modules/_metric_results.html.erb
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
7 </thead> 7 </thead>
8 8
9 <tbody> 9 <tbody>
10 - <%= render partial: 'metric_result', collection: @root_module_result.metric_results, locals: {module_result: @root_module_result} %> 10 + <% cache do %>
  11 + <%= render partial: 'metric_result', collection: @root_module_result.metric_results, locals: {module_result: @root_module_result} %>
  12 + <% end %>
11 </tbody> 13 </tbody>
12 </table> 14 </table>
13 \ No newline at end of file 15 \ No newline at end of file
app/views/modules/_module_tree.html.erb
@@ -13,16 +13,19 @@ @@ -13,16 +13,19 @@
13 <% unless @root_module_result.parent_id.nil? %> 13 <% unless @root_module_result.parent_id.nil? %>
14 <p id="parent"><i class="icon-arrow-up"></i><%= link_to '../', '#parent', onClick: "Module.Tree.load('#{escape_javascript(image_tag 'loader.gif')} Loading data. Please, wait.', #{@root_module_result.parent_id});" %></p> 14 <p id="parent"><i class="icon-arrow-up"></i><%= link_to '../', '#parent', onClick: "Module.Tree.load('#{escape_javascript(image_tag 'loader.gif')} Loading data. Please, wait.', #{@root_module_result.parent_id});" %></p>
15 <% end %> 15 <% end %>
16 -<% children = @root_module_result.children %>  
17 -<% unless children.empty? %>  
18 - <table class="table table-hover">  
19 - <thead>  
20 - <th>Name</th>  
21 - <th>Granularity</th>  
22 - <th>Grade</th>  
23 - </thead>  
24 - <tbody>  
25 - <%= render partial: 'module_result', collection: children %>  
26 - </tbody>  
27 - </table> 16 +
  17 +<% cache do %>
  18 + <% children = @root_module_result.children %>
  19 + <% unless children.empty? %>
  20 + <table class="table table-hover">
  21 + <thead>
  22 + <th>Name</th>
  23 + <th>Granularity</th>
  24 + <th>Grade</th>
  25 + </thead>
  26 + <tbody>
  27 + <%= render partial: 'module_result', collection: children %>
  28 + </tbody>
  29 + </table>
  30 + <% end %>
28 <% end %> 31 <% end %>
29 \ No newline at end of file 32 \ No newline at end of file