Sha256: cfb5431b71b3768e3882fe471afe54343e7b8dba7d13d6712f589e7d020e0859
Contents?: true
Size: 1.21 KB
Versions: 18
Compression:
Stored size: 1.21 KB
Contents
class SpudPostCategorySweeper < ActionController::Caching::Sweeper observe SpudPostCategory def after_save(record) expire_cache_for(record) end def after_destroy(record) expire_cache_for(record) end private def expire_cache_for(record) if Spud::Blog.config.enable_action_caching SpudPost.find_each do |p| if p.is_news && Spud::Blog.config.news_enabled expire_action news_post_url(p.url_name) elsif Spud::Blog.config.blog_enabled expire_action blog_post_url(p.url_name) end end expire_action news_url if Spud::Blog.config.news_enabled expire_action blog_url if Spud::Blog.config.blog_enabled expire_action spud_blog_sitemap_url end if Spud::Blog.config.enable_full_page_caching SpudPost.find_each do |p| if p.is_news && Spud::Blog.config.news_enabled expire_page news_post_path(p.url_name) elsif Spud::Blog.config.blog_enabled expire_page blog_post_path(p.url_name) end end expire_page news_path if Spud::Blog.config.news_enabled expire_page blog_path if Spud::Blog.config.blog_enabled expire_page spud_blog_sitemap_path(:format => :xml) end end end
Version data entries
18 entries across 18 versions & 1 rubygems