Class: PageSweeper
- Inherits:
-
ActionController::Caching::Sweeper
- Object
- ActionController::Caching::Sweeper
- PageSweeper
- Defined in:
- app/observers/page_sweeper.rb
Instance Method Summary collapse
Instance Method Details
#after_destroy(record) ⇒ Object
20 21 22 23 24 |
# File 'app/observers/page_sweeper.rb', line 20 def after_destroy(record) expire_cache_for(record) expire_page spud_cms_sitemap_path expire_page spud_sitemap_path end |
#after_save(record) ⇒ Object
14 15 16 17 18 |
# File 'app/observers/page_sweeper.rb', line 14 def after_save(record) expire_cache_for(record) expire_page spud_cms_sitemap_path(:format => :xml) expire_page spud_sitemap_path(:format => :xml) end |
#before_save(record) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'app/observers/page_sweeper.rb', line 4 def before_save(record) if record.is_a?(SpudPage) && record.url_name_was.blank? == false && record.url_name_was != record.url_name if Spud::Cms.cache_mode == :full_page expire_page cache_path_for_page(record.url_name_was) elsif Spud::Cms.cache_mode == :action expire_action cache_url_for_page(record.url_name_was) end end end |