diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-10-28 08:37:49 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-10-28 08:37:49 +0100 |
commit | b00f60f1d3d5415b5fd536191a7ee183ae910d03 (patch) | |
tree | fa36e5f3ef4128cbf6c55b88e4ea1ddaa2dc161e /app/models/status_stat.rb | |
parent | 008f98b30481dff2278d0687deb874f05de66b75 (diff) | |
parent | 26fe37c41460d6db3b5dd975a86c14fdd8dfadf3 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/models/status_stat.rb')
-rw-r--r-- | app/models/status_stat.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/status_stat.rb b/app/models/status_stat.rb index 9d358776b..024c467e7 100644 --- a/app/models/status_stat.rb +++ b/app/models/status_stat.rb @@ -14,4 +14,12 @@ class StatusStat < ApplicationRecord belongs_to :status, inverse_of: :status_stat + + after_commit :reset_parent_cache + + private + + def reset_parent_cache + Rails.cache.delete("statuses/#{status_id}") + end end |