1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

AC::Caching DRYup

Remove ActionController::Caching::Pages#caching_allowed
because it duplicates ActionController::Caching#caching_allowed?

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Krekoten' Marjan 2010-10-18 21:04:44 +03:00 committed by Santiago Pastorino
parent 19c144f1b3
commit 608bf7b72c

View file

@ -134,7 +134,7 @@ module ActionController #:nodoc:
# If no options are provided, the requested url is used. Example: # If no options are provided, the requested url is used. Example:
# cache_page "I'm the cached content", :controller => "lists", :action => "show" # cache_page "I'm the cached content", :controller => "lists", :action => "show"
def cache_page(content = nil, options = nil) def cache_page(content = nil, options = nil)
return unless self.class.perform_caching && caching_allowed return unless self.class.perform_caching && caching_allowed?
path = case options path = case options
when Hash when Hash
@ -148,10 +148,6 @@ module ActionController #:nodoc:
self.class.cache_page(content || response.body, path) self.class.cache_page(content || response.body, path)
end end
private
def caching_allowed
request.get? && response.status.to_i == 200
end
end end
end end
end end