Don't cache when logged in or there's a flash message. Moved canonical to protected methods.

This commit is contained in:
Philip Arndt 2012-03-20 15:16:58 +13:00
parent 460351e81f
commit 3049816aa9
2 changed files with 4 additions and 3 deletions

View file

@ -2,7 +2,7 @@ module Refinery
module Blog module Blog
class PostsController < BlogController 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_all_blog_posts, :except => [:archive]
before_filter :find_blog_post, :only => [:show, :comment, :update_nav] before_filter :find_blog_post, :only => [:show, :comment, :update_nav]
@ -76,6 +76,7 @@ module Refinery
@posts = Post.tagged_with(@tag_name).page(params[:page]) @posts = Post.tagged_with(@tag_name).page(params[:page])
end end
protected
def canonical? def canonical?
::Refinery.i18n_enabled? && ::Refinery::I18n.default_frontend_locale != ::Refinery::I18n.current_frontend_locale ::Refinery.i18n_enabled? && ::Refinery::I18n.default_frontend_locale != ::Refinery::I18n.current_frontend_locale
end end

View file

@ -3,7 +3,7 @@ module Refinery
class Version class Version
@major = 2 @major = 2
@minor = 0 @minor = 0
@tiny = 1 @tiny = 2
class << self class << self
attr_reader :major, :minor, :tiny attr_reader :major, :minor, :tiny