Permalink
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (16 sloc) 398 Bytes
class SiteSweeper < ActionController::Caching::Sweeper
observe Article, Category
def after_create(model)
expire_cache_for(model)
end
def after_update(model)
expire_cache_for(model)
end
def after_destroy(model)
expire_cache_for(model)
end
private
def expire_cache_for(model)
expire_page controller: 'page', action: 'index'
end
end