Created
October 2, 2009 22:51
-
-
Save overture8/200213 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PersonSweeper < ActionController::Caching::Sweeper | |
observe Person | |
def after_create(person) | |
expire_cache_for person | |
end | |
def after_update(person) | |
expire_cache_for person | |
end | |
def after_destroy(person) | |
expire_cache_for person | |
end | |
private | |
def expire_cache_for(person) | |
expire_page :action => :index | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment