Files
fizzy/app/models/card/cacheable.rb
T
Jorge Manrubia 1d1a3da9cf Cleanup workflow/stages
This was pending after moving to columns
2025-10-07 11:10:10 +02:00

28 lines
544 B
Ruby

module Card::Cacheable
extend ActiveSupport::Concern
def cache_key
[ super, collection.name ].compact.join("/")
end
def cache_invalidation_parts
@cache_invalidation_parts ||= InvalidationParts.new(self)
end
class InvalidationParts
attr_reader :card
def initialize(card)
@card = card
end
def for_perma(*other)
[ card, User.all, Tag.all, *other ]
end
def for_preview(*other)
[ card, card.collection.entropy_configuration, card.collection.publication, *other ]
end
end
end