From 261a3601b9de03a9622d9b0f406b310b3a804a6e Mon Sep 17 00:00:00 2001 From: Andy Gray Date: Tue, 31 Jul 2012 08:49:45 +1200 Subject: Removed page caching on posts, and the associated sweeper --- .../refinery/blog/admin/comments_controller.rb | 2 -- .../refinery/blog/admin/posts_controller.rb | 2 -- app/controllers/refinery/blog/posts_controller.rb | 2 -- app/sweepers/refinery/blog_sweeper.rb | 26 ---------------------- 4 files changed, 32 deletions(-) delete mode 100644 app/sweepers/refinery/blog_sweeper.rb (limited to 'app') diff --git a/app/controllers/refinery/blog/admin/comments_controller.rb b/app/controllers/refinery/blog/admin/comments_controller.rb index ce4ac70..dd9a351 100644 --- a/app/controllers/refinery/blog/admin/comments_controller.rb +++ b/app/controllers/refinery/blog/admin/comments_controller.rb @@ -3,8 +3,6 @@ module Refinery module Admin class CommentsController < ::Refinery::AdminController - cache_sweeper Refinery::BlogSweeper - crudify :'refinery/blog/comment', :title_attribute => :name, :order => 'published_at DESC' diff --git a/app/controllers/refinery/blog/admin/posts_controller.rb b/app/controllers/refinery/blog/admin/posts_controller.rb index cbde2f8..b5d7e63 100644 --- a/app/controllers/refinery/blog/admin/posts_controller.rb +++ b/app/controllers/refinery/blog/admin/posts_controller.rb @@ -3,8 +3,6 @@ module Refinery module Admin class PostsController < ::Refinery::AdminController - cache_sweeper Refinery::BlogSweeper - crudify :'refinery/blog/post', :order => 'published_at DESC', :include => [:translations] diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb index a236267..b04000b 100644 --- a/app/controllers/refinery/blog/posts_controller.rb +++ b/app/controllers/refinery/blog/posts_controller.rb @@ -2,8 +2,6 @@ module Refinery module Blog class PostsController < BlogController - caches_page :index, :unless => proc {|c| c.refinery_user_signed_in? || c.flash.any? || params[:page].present? } - before_filter :find_all_blog_posts, :except => [:archive] before_filter :find_blog_post, :only => [:show, :comment, :update_nav] before_filter :find_tags diff --git a/app/sweepers/refinery/blog_sweeper.rb b/app/sweepers/refinery/blog_sweeper.rb deleted file mode 100644 index a58ac7e..0000000 --- a/app/sweepers/refinery/blog_sweeper.rb +++ /dev/null @@ -1,26 +0,0 @@ -module Refinery - class BlogSweeper < ActionController::Caching::Sweeper - observe Blog::Post, Blog::Comment - - def after_create(record) - expire_cache_for(record) - end - - def after_update(record) - expire_cache_for(record) - end - - def after_destroy(record) - expire_cache_for(record) - end - - private - - def expire_cache_for(record) - # TODO: Convert these to url helpers - expire_page '/blog' - expire_page '/blog/feed.rss' - end - - end -end -- cgit v1.2.3