Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7769 from rgarver/feature/public-fragment_name_wi…

…th_digest

Move the CacheHelper#fragment_name_with_digest to be public
  • Loading branch information...
commit c0a182d54a5d718711be4f62d52070f738354822 2 parents d7d2284 + e3438b0
@dhh dhh authored
Showing with 12 additions and 11 deletions.
  1. +12 −11 actionpack/lib/action_view/helpers/cache_helper.rb
View
23 actionpack/lib/action_view/helpers/cache_helper.rb
@@ -113,6 +113,18 @@ def cache(name = {}, options = nil, &block)
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 @@ def fragment_for(name = {}, options = nil, &block) #:nodoc:
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
Please sign in to comment.
Something went wrong with that request. Please try again.