Skip to content

Commit

Permalink
AC::Caching DRYup
Browse files Browse the repository at this point in the history
Remove ActionController::Caching::Pages#caching_allowed
because it duplicates ActionController::Caching#caching_allowed?

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information
krekoten authored and spastorino committed Oct 18, 2010
1 parent 19c144f commit 608bf7b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions actionpack/lib/action_controller/caching/pages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def expire_page(options = {})
# 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 self.class.perform_caching && caching_allowed
return unless self.class.perform_caching && caching_allowed?

path = case options
when Hash
Expand All @@ -148,10 +148,6 @@ def cache_page(content = nil, options = nil)
self.class.cache_page(content || response.body, path)
end

private
def caching_allowed
request.get? && response.status.to_i == 200
end
end
end
end

0 comments on commit 608bf7b

Please sign in to comment.