Commit cffa7e173b95edecad14576823c42048fa84ae9b
Committed by
Rafael Manzo
1 parent
490117c2
Exists in
colab
and in
4 other branches
Caching to metric and module results.
Missing cache to graphics. Signed off by: Rafael Reggiani Manzo <rr.manzo@gmail.com>
Showing
2 changed files
with
18 additions
and
13 deletions
Show diff stats
app/views/modules/_metric_results.html.erb
| ... | ... | @@ -7,6 +7,8 @@ |
| 7 | 7 | </thead> |
| 8 | 8 | |
| 9 | 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 | 13 | </tbody> |
| 12 | 14 | </table> |
| 13 | 15 | \ No newline at end of file | ... | ... |
app/views/modules/_module_tree.html.erb
| ... | ... | @@ -13,16 +13,19 @@ |
| 13 | 13 | <% unless @root_module_result.parent_id.nil? %> |
| 14 | 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 | 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 | 31 | <% end %> |
| 29 | 32 | \ No newline at end of file | ... | ... |