From 9550b89b254cd59fe0610ccf6d3e46197cac3e50 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Wed, 5 Dec 2012 16:38:39 +0100 Subject: [PATCH] fix caching of todo where [C] and [P] were not part of the invariant thus the first generated todo was cached, leading to invalid todo in other views --- app/views/todos/_todo.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/todos/_todo.html.erb b/app/views/todos/_todo.html.erb index 9600ad87..2d28adc2 100644 --- a/app/views/todos/_todo.html.erb +++ b/app/views/todos/_todo.html.erb @@ -9,7 +9,8 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag' # invalidate the cache every day because of staleness or # rendering of "due in x days" that change without touching updated at of the todo -cache [todo, current_user.date.strftime("%Y%m%d")] do +# also make different caches per source_view to handle difference in showing [C] and [P] +cache [todo, current_user.date.strftime("%Y%m%d"), @source_view] do %>