From a618ad358a51beead39eca3bf3ee029b66f34f73 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 15 Apr 2010 02:21:01 -0300 Subject: Make use of config.perform_caching --- actionpack/lib/action_controller/caching/pages.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_controller/caching') diff --git a/actionpack/lib/action_controller/caching/pages.rb b/actionpack/lib/action_controller/caching/pages.rb index 21a424e6f0..801b9918c1 100644 --- a/actionpack/lib/action_controller/caching/pages.rb +++ b/actionpack/lib/action_controller/caching/pages.rb @@ -61,7 +61,7 @@ module ActionController #:nodoc: # Expires the page that was cached with the +path+ as a key. Example: # expire_page "/lists/show" def expire_page(path) - return unless perform_caching + return unless config.perform_caching path = page_cache_path(path) instrument_page_cache :expire_page, path do @@ -72,7 +72,7 @@ module ActionController #:nodoc: # Manually cache the +content+ in the key determined by +path+. Example: # cache_page "I'm the cached content", "/lists/show" def cache_page(content, path) - return unless perform_caching + return unless config.perform_caching path = page_cache_path(path) instrument_page_cache :write_page, path do @@ -92,7 +92,7 @@ module ActionController #:nodoc: # # cache the index action except for JSON requests # caches_page :index, :if => Proc.new { |c| !c.request.format.json? } def caches_page(*actions) - return unless perform_caching + return unless config.perform_caching options = actions.extract_options! after_filter({:only => actions}.merge(options)) { |c| c.cache_page } end @@ -116,7 +116,7 @@ module ActionController #:nodoc: # Expires the page that was cached with the +options+ as a key. Example: # expire_page :controller => "lists", :action => "show" def expire_page(options = {}) - return unless perform_caching + return unless config.perform_caching if options.is_a?(Hash) if options[:action].is_a?(Array) @@ -135,7 +135,7 @@ module ActionController #:nodoc: # If no options are provided, the requested url is used. Example: # cache_page "I'm the cached content", :controller => "lists", :action => "show" def cache_page(content = nil, options = nil) - return unless perform_caching && caching_allowed + return unless config.perform_caching && caching_allowed path = case options when Hash -- cgit v1.2.3