From e969ba955da04bf24a68475c1d24e138ae875ad0 Mon Sep 17 00:00:00 2001 From: Drew Ulmer Date: Tue, 27 Nov 2012 09:26:18 -0600 Subject: Add CHANGELOG entry for opt-out option of automatic template digesting --- actionpack/CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 1e47c7d66a..aa4872f3ac 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -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* -- cgit v1.2.3 From e105adc2406198b9af27f40b7e5bedd9de5d3a9b Mon Sep 17 00:00:00 2001 From: Drew Ulmer Date: Tue, 27 Nov 2012 09:27:41 -0600 Subject: Cleanup CacheHelper changes allowing opt-out of cache digests Instead of deleting the skip_digest option flag, this changes the method to merely check the key. This change is because of a discussion in this thread: https://github.com/rails/rails/pull/8317 This commit also makes #fragment_name_with_digest private due to its functionality being subsumed by #cache_fragment_name. --- actionpack/lib/action_view/helpers/cache_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionpack/lib/action_view/helpers/cache_helper.rb index fbaba63997..db920ae7a4 100644 --- a/actionpack/lib/action_view/helpers/cache_helper.rb +++ b/actionpack/lib/action_view/helpers/cache_helper.rb @@ -126,7 +126,7 @@ module ActionView # 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 @@ module ActionView end end + private def fragment_name_with_digest(name) #:nodoc: if @virtual_path [ @@ -146,7 +147,6 @@ module ActionView 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) -- cgit v1.2.3