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.
This commit is contained in:
Javi Martín
2019-03-22 14:11:33 +01:00
parent 66ecb2835b
commit 04a5e38874

View File

@@ -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