For example - i have a sweeper for one model(in this case About). class AboutSweeper < ActionController::Caching::Sweeper observe About def after_create(data) expire_about(data) end def after_save(data) expire_about(data) end def after_destroy(data) expire_about(data) end def expire_about(data) FileUtils.rm_rf File.expand_path("public/about/#{data.id}", RAILS_ROOT) FileUtils.rm_rf File.expand_path("public/index.html", RAILS_ROOT) end end
But I want to use one sweeper for several models. Can I write something like observer About, Book, Shop, City...... And expire this pages when i need? Or I need to create personal sweeper for model?
Thanks