From 3fdb7126110caad3f3db4c2b44ffc365b51c34eb Mon Sep 17 00:00:00 2001 From: Ryan Garver Date: Thu, 27 Sep 2012 08:41:51 -0700 Subject: Move the CacheHelper#fragment_name_with_digest to be public so custom fragment caching can benefit from it. --- actionpack/lib/action_view/helpers/cache_helper.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 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 59e1015976..52ede40a0c 100644 --- a/actionpack/lib/action_view/helpers/cache_helper.rb +++ b/actionpack/lib/action_view/helpers/cache_helper.rb @@ -113,6 +113,17 @@ module ActionView nil end + def fragment_name_with_digest(name) + if @virtual_path + [ + *Array(name.is_a?(Hash) ? controller.url_for(name).split("://").last : name), + Digestor.digest(@virtual_path, formats.last.to_sym, lookup_context) + ] + else + name + end + end + private # TODO: Create an object that has caching read/write on it def fragment_for(name = {}, options = nil, &block) #:nodoc: @@ -131,17 +142,6 @@ module ActionView controller.write_fragment(name, fragment, options) end end - - def fragment_name_with_digest(name) - if @virtual_path - [ - *Array(name.is_a?(Hash) ? controller.url_for(name).split("://").last : name), - Digestor.digest(@virtual_path, formats.last.to_sym, lookup_context) - ] - else - name - end - end end end end -- cgit v1.2.3 From e3438b0ca6d444224e0782b3acc24c45bc96f5ca Mon Sep 17 00:00:00 2001 From: Ryan Garver Date: Thu, 4 Oct 2012 08:16:43 -0700 Subject: Add nodoc to now public fragment_name_with_digest --- actionpack/lib/action_view/helpers/cache_helper.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionpack/lib/action_view/helpers/cache_helper.rb index 52ede40a0c..cfaac37672 100644 --- a/actionpack/lib/action_view/helpers/cache_helper.rb +++ b/actionpack/lib/action_view/helpers/cache_helper.rb @@ -113,6 +113,7 @@ module ActionView nil end + #:nodoc: def fragment_name_with_digest(name) if @virtual_path [ -- cgit v1.2.3