aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/cache_helper.rb
diff options
context:
space:
mode:
authorRyan Garver <ragarver@gmail.com>2012-09-27 08:41:51 -0700
committerRyan Garver <ragarver@gmail.com>2012-09-27 08:41:51 -0700
commit3fdb7126110caad3f3db4c2b44ffc365b51c34eb (patch)
treee6ec7d4a471c87282b7480c4cca7e2c38f346af5 /actionpack/lib/action_view/helpers/cache_helper.rb
parent1b73dbd36fc5bd2d8ae015a16b2376250ab19b4e (diff)
downloadrails-3fdb7126110caad3f3db4c2b44ffc365b51c34eb.tar.gz
rails-3fdb7126110caad3f3db4c2b44ffc365b51c34eb.tar.bz2
rails-3fdb7126110caad3f3db4c2b44ffc365b51c34eb.zip
Move the CacheHelper#fragment_name_with_digest to be public so custom fragment caching can benefit from it.
Diffstat (limited to 'actionpack/lib/action_view/helpers/cache_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/cache_helper.rb22
1 files changed, 11 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..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