Skip to content

Commit 7fd17d9

Browse files
committed
Ensure platform css block is considered in cache key
1 parent 9423915 commit 7fd17d9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/models/better_together/platform.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ class Platform < ApplicationRecord
4343
before_save :purge_profile_image, if: -> { remove_profile_image == '1' }
4444
before_save :purge_cover_image, if: -> { remove_cover_image == '1' }
4545

46+
def cache_key
47+
"#{super}/#{css_block&.updated_at&.to_i}"
48+
end
49+
50+
# TODO: Updating the css_block contents does not update the platform cache key. Needs platform attribute update before changes take effect.
4651
def css_block
4752
@css_block ||= blocks.find_by(type: 'BetterTogether::Content::Css')
4853
end

0 commit comments

Comments
 (0)