From af70363d029202b53c5813e06117dfdc1208cccd Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 22 Jul 2010 19:53:11 +0100 Subject: [PATCH] Don't cache actions with a page number --- app/controllers/application_controller.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c50c5f664..1605e1133 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -249,6 +249,16 @@ class ApplicationController < ActionController::Base options = actions.extract_options! cache_path = options[:cache_path] || Hash.new + options[:unless] = case options[:unless] + when NilClass then Array.new + when Array then options[:unless] + else unlessp = [ options[:unless] ] + end + + options[:unless].push(Proc.new do |controller| + controller.params.include?(:page) + end) + options[:cache_path] = Proc.new do |controller| cache_path.merge(controller.params).merge(:locale => I18n.locale) end -- 2.43.2