2007-01-22 07:43:50 -06:00
|
|
|
require_dependency 'cache_sweeping_helper'
|
|
|
|
|
|
|
|
class WebSweeper < ActionController::Caching::Sweeper
|
|
|
|
|
|
|
|
include CacheSweepingHelper
|
|
|
|
|
|
|
|
observe Web
|
|
|
|
|
|
|
|
def after_save(record)
|
|
|
|
web = record
|
|
|
|
web.pages.each { |page| expire_cached_page(web, page.name) }
|
|
|
|
expire_cached_summary_pages(web)
|
|
|
|
end
|
2008-10-27 01:47:01 -05:00
|
|
|
|
|
|
|
def after_remove_orphaned_pages(web)
|
|
|
|
expire_cached_summary_pages(web)
|
|
|
|
end
|
2008-12-06 16:11:47 -06:00
|
|
|
|
|
|
|
def after_remove_orphaned_pages_in_category(web)
|
|
|
|
expire_cached_summary_pages(web)
|
|
|
|
end
|
|
|
|
|
2007-01-22 07:43:50 -06:00
|
|
|
end
|