Add caching_allowed? that was removed from Rails 4 core #1

Merged
merged 2 commits into from Jan 28, 2013

Conversation

Projects
None yet
4 participants
Contributor

michiels commented Jan 28, 2013

No description provided.

@frodsan frodsan commented on the diff Jan 28, 2013

lib/action_controller/caching/pages.rb
@@ -185,6 +185,10 @@ def cache_page(content = nil, options = nil, gzip = Zlib::BEST_COMPRESSION)
self.class.cache_page(content || response.body, path, extension, gzip)
end
+
+ def caching_allowed?
+ (request.get? || request.head?) && response.status == 200
@frodsan

frodsan Jan 28, 2013

Contributor

@carlosantoniodasilva Is it ok to support head?

@frodsan

frodsan Jan 28, 2013

Contributor

Can you add actionpack-page_caching and actionpack-action_caching to Travis?

@frodsan

frodsan Jan 28, 2013

Contributor

Thanks 👍

@frodsan

frodsan Jan 29, 2013

Contributor

Any plans to push these gems up to Rubygems?

@rafaelfranca

rafaelfranca Jan 29, 2013

Owner

I'll do this week

@frodsan frodsan pushed a commit that referenced this pull request Jan 28, 2013

Francesco Rodríguez Merge pull request #1 from michiels/add-caching-allowed
Add caching_allowed? that was removed from Rails 4 core
c69dc22

@frodsan frodsan merged commit c69dc22 into rails:master Jan 28, 2013

Contributor

frodsan commented Jan 28, 2013

Thanks! 😄

Contributor

michiels commented Jan 28, 2013

Yay!

michiels deleted the michiels:add-caching-allowed branch Jan 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment