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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user