Sha256: e764b3344c3652be0f497116934633c57888e55424d48f6e7b3f281d97390bcd
Contents?: true
Size: 778 Bytes
Versions: 16
Compression:
Stored size: 778 Bytes
Contents
class SpudPostCommentSweeper < ActionController::Caching::Sweeper observe SpudPostComment def after_save(record) expire_cache_for(record) end def after_destroy(record) expire_cache_for(record) end private def expire_cache_for(record) unless record.post.nil? if Spud::Blog.config.cache_mode == :action if record.post.is_news expire_action news_post_url(record.post.url_name) else expire_action blog_post_url(record.post.url_name) end end if Spud::Blog.config.cache_mode == :full_page if record.post.is_news expire_page news_post_path(record.post.url_name) else expire_page blog_post_path(record.post.url_name) end end end end end
Version data entries
16 entries across 16 versions & 2 rubygems