1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/app/sweepers/stylesheet_sweeper.rb

11 lines
308 B
Ruby

# frozen_string_literal: true
# Build a cached version of the CSS stylesheet
class StylesheetSweeper < ActionController::Caching::Sweeper
observe Stylesheet
def after_update(record)
expire_page(controller: 'stylesheets', action: 'show', id: record.id) if record.saved_change_to_contents?
end
end