aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/template/handlers
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-02-15 22:47:44 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-02-20 16:54:32 +0100
commitb4558c10fb8f5379ffe23860c9ad1ee7a227de44 (patch)
treee970d2796ba27d9d6d5ef7bf4a747103f69104d6 /actionview/lib/action_view/template/handlers
parent454bc1deab3b60f6b4cbe36227471ed40f4c38f9 (diff)
downloadrails-b4558c10fb8f5379ffe23860c9ad1ee7a227de44.tar.gz
rails-b4558c10fb8f5379ffe23860c9ad1ee7a227de44.tar.bz2
rails-b4558c10fb8f5379ffe23860c9ad1ee7a227de44.zip
Make collection caching explicit.
Having collection caching that wraps templates and automatically tries to infer if they are cachable proved to be too much of a hassle. We'd rather have it be something you explicitly turn on. This removes much of the code and docs to explain the previous automatic behavior. This change also removes scoped cache keys and passing cache_options.
Diffstat (limited to 'actionview/lib/action_view/template/handlers')
-rw-r--r--actionview/lib/action_view/template/handlers/erb.rb25
1 files changed, 0 insertions, 25 deletions
diff --git a/actionview/lib/action_view/template/handlers/erb.rb b/actionview/lib/action_view/template/handlers/erb.rb
index 1f8459c24b..85a100ed4c 100644
--- a/actionview/lib/action_view/template/handlers/erb.rb
+++ b/actionview/lib/action_view/template/handlers/erb.rb
@@ -123,31 +123,6 @@ module ActionView
).src
end
- # Returns Regexp to extract a cached resource's name from a cache call at the
- # first line of a template.
- # The extracted cache name is captured as :resource_name.
- #
- # <% cache notification do %> # => notification
- #
- # The pattern should support templates with a beginning comment:
- #
- # <%# Still extractable even though there's a comment %>
- # <% cache notification do %> # => notification
- #
- # But fail to extract a name if a resource association is cached.
- #
- # <% cache notification.event do %> # => nil
- def resource_cache_call_pattern
- /\A
- (?:<%\#.*%>)* # optional initial comment
- \s* # followed by optional spaces or newlines
- <%\s*cache[\(\s] # followed by an ERB call to cache
- \s* # followed by optional spaces or newlines
- (?<resource_name>\w+) # capture the cache call argument as :resource_name
- [\s\)] # followed by a space or close paren
- /xm
- end
-
private
def valid_encoding(string, encoding)