aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/caching/pages.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-04-15 02:21:01 -0300
committerwycats <wycats@gmail.com>2010-04-14 22:35:13 -0700
commita618ad358a51beead39eca3bf3ee029b66f34f73 (patch)
tree36455d0b5515df6591aea1c4d4328d5535abfd11 /actionpack/lib/action_controller/caching/pages.rb
parentfc22552e5f9abc9d5449f5b3c0d347e53d7d7575 (diff)
downloadrails-a618ad358a51beead39eca3bf3ee029b66f34f73.tar.gz
rails-a618ad358a51beead39eca3bf3ee029b66f34f73.tar.bz2
rails-a618ad358a51beead39eca3bf3ee029b66f34f73.zip
Make use of config.perform_caching
Diffstat (limited to 'actionpack/lib/action_controller/caching/pages.rb')
-rw-r--r--actionpack/lib/action_controller/caching/pages.rb10
1 files changed, 5 insertions, 5 deletions
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