Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (20 sloc) 0.499 kB
module Refinery
class BlogSweeper < ActionController::Caching::Sweeper
observe Blog::Post, Blog::Comment
def after_create(record)
expire_cache_for(record)
end
def after_update(record)
expire_cache_for(record)
end
def after_destroy(record)
expire_cache_for(record)
end
private
def expire_cache_for(record)
# TODO: Convert these to url helpers
expire_page '/blog'
expire_page '/blog/feed.rss'
end
end
end
Jump to Line
Something went wrong with that request. Please try again.