From 04a5e38874ea841caea00111a22d73fd65c42789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 22 Mar 2019 14:11:33 +0100 Subject: [PATCH] Expire budget stats cache when a phase is finished This way we recalculate all data including the participants in the phase which has just finished. --- app/models/budget/stats.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/budget/stats.rb b/app/models/budget/stats.rb index f627c59e7..91ec12a86 100644 --- a/app/models/budget/stats.rb +++ b/app/models/budget/stats.rb @@ -178,6 +178,6 @@ class Budget::Stats stats_cache :voters, :participants, :authors, :balloters, :poll_ballot_voters def stats_cache(key, &block) - Rails.cache.fetch("budgets_stats/#{budget.id}/#{key}/v10", &block) + Rails.cache.fetch("budgets_stats/#{budget.id}/#{phases.join}/#{key}/v10", &block) end end