Sha256: 8b49fc7eb8380e345f476095eca0ad68ba9ed76b27670a8c24c960408a783d42
Contents?: true
Size: 779 Bytes
Versions: 21
Compression:
Stored size: 779 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.enable_action_caching 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.enable_full_page_caching 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
21 entries across 21 versions & 1 rubygems