You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching.rb#L57" target="_blank" class="github_url">🔎 See on GitHub</a>
134
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching.rb#L57" target="_blank" class="github_url">🔎 See on GitHub</a>
135
135
136
136
</details>
137
137
@@ -165,15 +165,15 @@ <h3 id="method-i-cache">
165
165
</summary>
166
166
167
167
<pre><codeclass="ruby"># File actionpack/lib/abstract_controller/caching.rb, line 63
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching.rb#L63" target="_blank" class="github_url">🔎 See on GitHub</a>
176
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching.rb#L63" target="_blank" class="github_url">🔎 See on GitHub</a>
<pre><codeclass="ruby"># File actionpack/lib/abstract_controller/caching.rb, line 52
85
-
def view_cache_dependency(&dependency)
86
-
self._view_cache_dependencies += [dependency]
87
-
end</code></pre>
85
+
def view_cache_dependency(&dependency)
86
+
self._view_cache_dependencies += [dependency]
87
+
end</code></pre>
88
88
89
-
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching.rb#L52" target="_blank" class="github_url">🔎 See on GitHub</a>
89
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching.rb#L52" target="_blank" class="github_url">🔎 See on GitHub</a>
<pre><codeclass="ruby"># File actionpack/lib/abstract_controller/caching.rb, line 15
89
-
def cache_store
90
-
config.cache_store
91
-
end</code></pre>
89
+
def cache_store
90
+
config.cache_store
91
+
end</code></pre>
92
92
93
-
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching.rb#L15" target="_blank" class="github_url">🔎 See on GitHub</a>
93
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching.rb#L15" target="_blank" class="github_url">🔎 See on GitHub</a>
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching.rb#L19" target="_blank" class="github_url">🔎 See on GitHub</a>
128
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching.rb#L19" target="_blank" class="github_url">🔎 See on GitHub</a>
<p>Given a key (as described in <code>expire_fragment</code>), returns a key array suitable for use in reading, writing, or expiring a cached fragment. All keys begin with <code>:views</code>, followed by <code>ENV["RAILS_CACHE_ID"]</code> or <code>ENV["RAILS_APP_VERSION"]</code> if set, followed by any controller-wide key prefix values, ending with the specified <code>key</code> value.</p>
111
+
<p>Given a key (as described in <ahref="Fragments.html#method-i-expire_fragment"><code>expire_fragment</code></a>), returns a key array suitable for use in reading, writing, or expiring a cached fragment. All keys begin with <code>:views</code>, followed by <code>ENV["RAILS_CACHE_ID"]</code> or <code>ENV["RAILS_APP_VERSION"]</code> if set, followed by any controller-wide key prefix values, ending with the specified <code>key</code> value.</p>
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching/fragments.rb#L68" target="_blank" class="github_url">🔎 See on GitHub</a>
137
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching/fragments.rb#L68" target="_blank" class="github_url">🔎 See on GitHub</a>
instrument_fragment_cache :expire_fragment, key do
184
+
if key.is_a?(Regexp)
185
+
cache_store.delete_matched(key, options)
186
+
else
187
+
cache_store.delete(key, options)
188
+
end
189
+
end
190
+
end</code></pre>
191
191
192
-
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching/fragments.rb#L131" target="_blank" class="github_url">🔎 See on GitHub</a>
192
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching/fragments.rb#L131" target="_blank" class="github_url">🔎 See on GitHub</a>
<p>Check if a cached fragment from the location signified by <code>key</code> exists (see <code>expire_fragment</code> for acceptable formats).</p>
207
+
<p>Check if a cached fragment from the location signified by <code>key</code> exists (see <ahref="Fragments.html#method-i-expire_fragment"><code>expire_fragment</code></a> for acceptable formats).</p>
<pre><codeclass="ruby"># File actionpack/lib/abstract_controller/caching/fragments.rb, line 105
223
-
def fragment_exist?(key, options = nil)
224
-
return unless cache_configured?
225
-
key = combined_fragment_cache_key(key)
226
-
227
-
instrument_fragment_cache :exist_fragment?, key do
228
-
cache_store.exist?(key, options)
229
-
end
230
-
end</code></pre>
223
+
def fragment_exist?(key, options = nil)
224
+
return unless cache_configured?
225
+
key = combined_fragment_cache_key(key)
226
+
227
+
instrument_fragment_cache :exist_fragment?, key do
228
+
cache_store.exist?(key, options)
229
+
end
230
+
end</code></pre>
231
231
232
-
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching/fragments.rb#L105" target="_blank" class="github_url">🔎 See on GitHub</a>
232
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching/fragments.rb#L105" target="_blank" class="github_url">🔎 See on GitHub</a>
<p>Reads a cached fragment from the location signified by <code>key</code> (see <code>expire_fragment</code> for acceptable formats).</p>
247
+
<p>Reads a cached fragment from the location signified by <code>key</code> (see <ahref="Fragments.html#method-i-expire_fragment"><code>expire_fragment</code></a> for acceptable formats).</p>
<pre><codeclass="ruby"># File actionpack/lib/abstract_controller/caching/fragments.rb, line 93
263
-
def read_fragment(key, options = nil)
264
-
return unless cache_configured?
265
-
266
-
key = combined_fragment_cache_key(key)
267
-
instrument_fragment_cache :read_fragment, key do
268
-
result = cache_store.read(key, options)
269
-
result.respond_to?(:html_safe) ? result.html_safe : result
270
-
end
271
-
end</code></pre>
263
+
def read_fragment(key, options = nil)
264
+
return unless cache_configured?
265
+
266
+
key = combined_fragment_cache_key(key)
267
+
instrument_fragment_cache :read_fragment, key do
268
+
result = cache_store.read(key, options)
269
+
result.respond_to?(:html_safe) ? result.html_safe : result
270
+
end
271
+
end</code></pre>
272
272
273
-
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching/fragments.rb#L93" target="_blank" class="github_url">🔎 See on GitHub</a>
273
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching/fragments.rb#L93" target="_blank" class="github_url">🔎 See on GitHub</a>
<p>Writes <code>content</code> to the location signified by <code>key</code> (see <code>expire_fragment</code> for acceptable formats).</p>
288
+
<p>Writes <code>content</code> to the location signified by <code>key</code> (see <ahref="Fragments.html#method-i-expire_fragment"><code>expire_fragment</code></a> for acceptable formats).</p>
<pre><codeclass="ruby"># File actionpack/lib/abstract_controller/caching/fragments.rb, line 80
304
-
def write_fragment(key, content, options = nil)
305
-
return content unless cache_configured?
306
-
307
-
key = combined_fragment_cache_key(key)
308
-
instrument_fragment_cache :write_fragment, key do
309
-
content = content.to_str
310
-
cache_store.write(key, content, options)
311
-
end
312
-
content
313
-
end</code></pre>
304
+
def write_fragment(key, content, options = nil)
305
+
return content unless cache_configured?
306
+
307
+
key = combined_fragment_cache_key(key)
308
+
instrument_fragment_cache :write_fragment, key do
309
+
content = content.to_str
310
+
cache_store.write(key, content, options)
311
+
end
312
+
content
313
+
end</code></pre>
314
314
315
-
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching/fragments.rb#L80" target="_blank" class="github_url">🔎 See on GitHub</a>
315
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching/fragments.rb#L80" target="_blank" class="github_url">🔎 See on GitHub</a>
<pre><codeclass="ruby"># File actionpack/lib/abstract_controller/caching/fragments.rb, line 58
101
-
def fragment_cache_key(value = nil, &key)
102
-
self.fragment_cache_keys += [key || -> { value }]
103
-
end</code></pre>
101
+
def fragment_cache_key(value = nil, &key)
102
+
self.fragment_cache_keys += [key || -> { value }]
103
+
end</code></pre>
104
104
105
-
<ahref="https://github.com/rails/rails/blob/80827ca7ff33ca3026f2c74fe8249ccc6f513318/actionpack/lib/abstract_controller/caching/fragments.rb#L58" target="_blank" class="github_url">🔎 See on GitHub</a>
105
+
<ahref="https://github.com/rails/rails/blob/4720fe9c00605d6ad2d50904e98a4d5522ffbce2/actionpack/lib/abstract_controller/caching/fragments.rb#L58" target="_blank" class="github_url">🔎 See on GitHub</a>
0 commit comments