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
22 23 24 25 26 |
# File 'app/observers/page_sweeper.rb', line 22 def after_destroy(record) expire_cache_for(record) expire_page spud_cms_sitemap_path expire_page spud_sitemap_path end |
#after_save(record) ⇒ Object
16 17 18 19 20 |
# File 'app/observers/page_sweeper.rb', line 16 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
6 7 8 9 10 11 12 13 14 |
# File 'app/observers/page_sweeper.rb', line 6 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 |