aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2012-10-04 08:30:49 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2012-10-04 08:30:49 -0700
commitc0a182d54a5d718711be4f62d52070f738354822 (patch)
tree1334979eec6bdf784b7b2f18195b27953c3d46b7
parentd7d228402efd1ddbbdb2b15d2e91ec22693b9298 (diff)
parente3438b0ca6d444224e0782b3acc24c45bc96f5ca (diff)
downloadrails-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
-rw-r--r--actionpack/lib/action_view/helpers/cache_helper.rb23
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