From fb294f212db7e33aecc45d81cf3e81e7f0a389ee Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Thu, 30 Jan 2014 10:46:22 -0200 Subject: [PATCH] Better cache fragment keys and chart labels --- app/views/modules/_metric_results.html.erb | 2 +- app/views/modules/_module_tree.html.erb | 2 +- app/views/modules/metric_history.js.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/modules/_metric_results.html.erb b/app/views/modules/_metric_results.html.erb index faf77aa..f348c0c 100644 --- a/app/views/modules/_metric_results.html.erb +++ b/app/views/modules/_metric_results.html.erb @@ -7,7 +7,7 @@ - <% cache do %> + <% cache("#{@root_module_result.id}_results") do %> <%= render partial: 'metric_result', collection: @root_module_result.metric_results, locals: {module_result: @root_module_result} %> <% end %> diff --git a/app/views/modules/_module_tree.html.erb b/app/views/modules/_module_tree.html.erb index a9c67f2..6e5839b 100644 --- a/app/views/modules/_module_tree.html.erb +++ b/app/views/modules/_module_tree.html.erb @@ -14,7 +14,7 @@

<%= link_to '../', '#parent', onClick: "Module.Tree.load('#{escape_javascript(image_tag 'loader.gif')} Loading data. Please, wait.', #{@root_module_result.parent_id});" %>

<% end %> -<% cache do %> +<% cache("#{@root_module_result.id}_tree") do %> <% children = @root_module_result.children %> <% unless children.empty? %> diff --git a/app/views/modules/metric_history.js.erb b/app/views/modules/metric_history.js.erb index c0d9b61..deaba54 100644 --- a/app/views/modules/metric_history.js.erb +++ b/app/views/modules/metric_history.js.erb @@ -5,7 +5,7 @@ var values = []; <% metric_history.keys.each do |date| %> - dates.push("<%= date %>"); + dates.push("<%= date.to_s[0,10] %>"); values.push(<%= metric_history[date] %>); <% end %> -- libgit2 0.21.2