Merge pull request #8339 from latortuga/cache-digest-opt-out-cleanup

Cache digest opt out cleanup
This commit is contained in:
Rafael Mendonça França 2012-11-27 10:19:55 -08:00
commit 6c0ea8875f
2 changed files with 10 additions and 2 deletions

@ -1,5 +1,13 @@
## Rails 4.0.0 (unreleased) ##
* Add option flag to `CacheHelper#cache` to manually bypass automatic template digests:
<% cache project, skip_digest: true do %>
...
<% end %>
*Drew Ulmer*
* No sort Hash options in #grouped_options_for_select. *Sergey Kojin*
* Accept symbols as #send_data :disposition value *Elia Schito*

@ -126,7 +126,7 @@ def cache(name = {}, options = nil, &block)
# cannot be manually expired unless you know the exact key which is the
# case when using memcached.
def cache_fragment_name(name = {}, options = nil)
skip_digest = options && options.delete(:skip_digest)
skip_digest = options && options[:skip_digest]
if skip_digest
name
@ -135,6 +135,7 @@ def cache_fragment_name(name = {}, options = nil)
end
end
private
def fragment_name_with_digest(name) #:nodoc:
if @virtual_path
[
@ -146,7 +147,6 @@ def fragment_name_with_digest(name) #:nodoc:
end
end
private
# TODO: Create an object that has caching read/write on it
def fragment_for(name = {}, options = nil, &block) #:nodoc:
if fragment = controller.read_fragment(name, options)