From 13262ea61433cce3b8d96fe53d5d9255ef5fba7f Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 27 Apr 2019 20:14:47 -0500 Subject: Remove cached status when sharekey changed. --- app/lib/bangtags.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/lib') diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb index 6f2f03d30..c1bb62c3d 100644 --- a/app/lib/bangtags.rb +++ b/app/lib/bangtags.rb @@ -251,6 +251,7 @@ class Bangtags if roar.sharekey.present? roar.sharekey = nil roar.save + Rails.cache.delete("statuses/#{roar.id}") end end end @@ -262,6 +263,7 @@ class Bangtags sharekey = SecureRandom.urlsafe_base64(32) earliest_roar.sharekey = sharekey earliest_roar.save + Rails.cache.delete("statuses/#{earliest_roar.id}") else sharekey = earliest_roar.sharekey end @@ -269,11 +271,13 @@ class Bangtags if roar.sharekey != sharekey roar.sharekey = sharekey roar.save + Rails.cache.delete("statuses/#{roar.id}") end end else status.sharekey = SecureRandom.urlsafe_base64(32) status.save + Rails.cache.delete("statuses/#{status.id}") end end end -- cgit