diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2012-10-04 08:30:49 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2012-10-04 08:30:49 -0700 |
commit | c0a182d54a5d718711be4f62d52070f738354822 (patch) | |
tree | 1334979eec6bdf784b7b2f18195b27953c3d46b7 /actionpack | |
parent | d7d228402efd1ddbbdb2b15d2e91ec22693b9298 (diff) | |
parent | e3438b0ca6d444224e0782b3acc24c45bc96f5ca (diff) | |
download | rails-c0a182d54a5d718711be4f62d52070f738354822.tar.gz rails-c0a182d54a5d718711be4f62d52070f738354822.tar.bz2 rails-c0a182d54a5d718711be4f62d52070f738354822.zip |
Merge pull request #7769 from rgarver/feature/public-fragment_name_with_digest
Move the CacheHelper#fragment_name_with_digest to be public
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/cache_helper.rb | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionpack/lib/action_view/helpers/cache_helper.rb index 59e1015976..cfaac37672 100644 --- a/actionpack/lib/action_view/helpers/cache_helper.rb +++ b/actionpack/lib/action_view/helpers/cache_helper.rb @@ -113,6 +113,18 @@ module ActionView nil end + #:nodoc: + 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 +143,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 |