aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2012-03-20 15:16:58 +1300
committerPhilip Arndt <parndt@gmail.com>2012-03-20 15:16:58 +1300
commit3049816aa975d32b5ee67ed9d4bf7946ea147f6c (patch)
treee895092521417795c2e84eb0b84737dbdf0f65b5 /app
parent460351e81ffa6f8ed39cc5134ff4c30d7e191a51 (diff)
downloadrefinerycms-blog-3049816aa975d32b5ee67ed9d4bf7946ea147f6c.tar.gz
refinerycms-blog-3049816aa975d32b5ee67ed9d4bf7946ea147f6c.tar.bz2
refinerycms-blog-3049816aa975d32b5ee67ed9d4bf7946ea147f6c.zip
Don't cache when logged in or there's a flash message. Moved canonical to protected methods.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/refinery/blog/posts_controller.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb
index bde3a9c..5218493 100644
--- a/app/controllers/refinery/blog/posts_controller.rb
+++ b/app/controllers/refinery/blog/posts_controller.rb
@@ -2,7 +2,7 @@ module Refinery
module Blog
class PostsController < BlogController
- caches_page :index
+ caches_page :index, :unless => proc {|c| c.refinery_user_signed_in? || c.flash.any? }
before_filter :find_all_blog_posts, :except => [:archive]
before_filter :find_blog_post, :only => [:show, :comment, :update_nav]
@@ -23,7 +23,7 @@ module Refinery
@comment = Comment.new
@canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical?
-
+
@post.increment!(:access_count, 1)
respond_with (@post) do |format|
@@ -76,6 +76,7 @@ module Refinery
@posts = Post.tagged_with(@tag_name).page(params[:page])
end
+ protected
def canonical?
::Refinery.i18n_enabled? && ::Refinery::I18n.default_frontend_locale != ::Refinery::I18n.current_frontend_locale
end