summaryrefslogtreecommitdiff
path: root/spec/support/caching.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/caching.rb')
-rw-r--r--spec/support/caching.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/support/caching.rb b/spec/support/caching.rb
index 11e4f534971..b18223523db 100644
--- a/spec/support/caching.rb
+++ b/spec/support/caching.rb
@@ -37,8 +37,8 @@ RSpec.configure do |config|
end
config.around(:each, :use_sql_query_cache) do |example|
- ActiveRecord::Base.cache do
- example.run
- end
+ base_models = Gitlab::Database.database_base_models_with_gitlab_shared.values
+ inner_proc = proc { example.run }
+ base_models.inject(inner_proc) { |proc, base_model| proc { base_model.cache { proc.call } } }.call
end
end