instiki/app/controllers/web_sweeper.rb
Jacques Distler 7600aef48b Upgrade to Rails 2.2.0
As a side benefit, fix an (non-user-visible) bug in display_s5().
Also fixed a bug where removing orphaned pages did not expire cached summary pages.
2008-10-27 01:47:01 -05:00

19 lines
384 B
Ruby

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
def after_remove_orphaned_pages(web)
expire_cached_summary_pages(web)
end
end