Merge pull request #566 from basecamp/fix-caching

Invalidate card caches when editing workflows
This commit is contained in:
Jorge Manrubia
2025-06-02 18:09:52 +02:00
committed by GitHub
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
class Workflow::Stage < ApplicationRecord
belongs_to :workflow
belongs_to :workflow, touch: true
before_validation :assign_random_color, on: :create
+1 -1
View File
@@ -1,4 +1,4 @@
<% cache card do %>
<% cache [ card, card.collection.workflow ] do %>
<%= card_article_tag card, class: "card" do %>
<div class="flex gap">
<div class="flex flex-column flex-item-grow">
@@ -8,7 +8,7 @@
<% end %>
<% if page.used? %>
<%= render partial: "cards/display/preview", collection: page.records, as: :card, cached: true %>
<%= render partial: "cards/display/preview", collection: page.records, as: :card, cached: ->(record) { [ record, record.collection.workflow ] } %>
<% unless page.last? %>
<%= cards_next_page_link "doing-cards", page: page, filter: filter %>