mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Move the CacheHelper#fragment_name_with_digest to be public so custom fragment caching can benefit from it.
This commit is contained in:
parent
1b73dbd36f
commit
3fdb712611
1 changed files with 11 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue