We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 191510a commit 7bfce52Copy full SHA for 7bfce52
test/support/core_ext/query_cache.rb
@@ -22,7 +22,13 @@ module SqlIgnoredCache
22
# compromising cache outside tests.
23
def cache_sql(sql, name, binds)
24
result = super
25
- @query_cache.delete_if { |k, v| k =~ Regexp.union(IGNORED_SQL) }
+
26
+ @query_cache.delete_if do |cache_key, _v|
27
+ # Query cache key generated by `sql` or `[sql, binds]`, so need to retrieve `sql` for both cases.
28
+ cache_key_sql = Array(cache_key).first
29
+ Regexp.union(IGNORED_SQL).match?(cache_key_sql)
30
+ end
31
32
result
33
end
34
0 commit comments