From fcba8b6acb7b2bcb63218f80007bd8dd19c53331 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 8 Oct 2025 17:08:32 -0500 Subject: [PATCH] Add column color to cache keys So cards change colors when you change the column color --- app/helpers/cards_helper.rb | 2 +- app/models/card/cacheable.rb | 2 +- app/views/cards/_card.json.jbuilder | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/cards_helper.rb b/app/helpers/cards_helper.rb index 03b0f3206..07a6b931f 100644 --- a/app/helpers/cards_helper.rb +++ b/app/helpers/cards_helper.rb @@ -35,6 +35,6 @@ module CardsHelper end def cacheable_preview_parts_for(card, *options) - [ card, card.collection, card.collection.entropy_configuration, card.collection.publication, *options ] + [ card, card.collection, card.collection.entropy_configuration, card.collection.publication, card.column&.color, *options ] end end diff --git a/app/models/card/cacheable.rb b/app/models/card/cacheable.rb index c0aac0dd5..a3047c88d 100644 --- a/app/models/card/cacheable.rb +++ b/app/models/card/cacheable.rb @@ -21,7 +21,7 @@ module Card::Cacheable end def for_preview(*other) - [ card, card.collection.entropy_configuration, card.collection.publication, *other ] + [ card, card.collection.entropy_configuration, card.collection.publication, card.column&.color, *other ] end end end diff --git a/app/views/cards/_card.json.jbuilder b/app/views/cards/_card.json.jbuilder index 15926a921..cf355565e 100644 --- a/app/views/cards/_card.json.jbuilder +++ b/app/views/cards/_card.json.jbuilder @@ -1,4 +1,4 @@ -json.cache! card do +json.cache! [card, card.column&.color] do json.(card, :id, :title, :status) json.image_url card.image.presence && url_for(card.image)