Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add caching_allowed? that has been removed from Rails core

  • Loading branch information...
commit 730674ff328990cfdec711dd675d33ffa821268e 1 parent d27f721
@michiels michiels authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/action_controller/caching/actions.rb
View
4 lib/action_controller/caching/actions.rb
@@ -115,6 +115,10 @@ def _save_fragment(name, options)
end
end
+ def caching_allowed?
+ (request.get? || request.head?) && response.status == 200
+ end
+
protected
def expire_action(options = {})
return unless cache_configured?
Please sign in to comment.
Something went wrong with that request. Please try again.