From 7e4c00ba3f97b80e9df947f08ecee92f893d8d3b Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 5 May 2020 18:44:48 +0200 Subject: [PATCH] Ensure caching works in cache tests for API controllers --- app/models/concerns/api_action_caching.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/api_action_caching.rb b/app/models/concerns/api_action_caching.rb index ef0eba604d..05dbc9f0d4 100644 --- a/app/models/concerns/api_action_caching.rb +++ b/app/models/concerns/api_action_caching.rb @@ -11,8 +11,9 @@ module ApiActionCaching include ActionController::Caching::Actions include AbstractController::Layouts - # This config is not passed to the controller automatically with ActionController::Metal + # These configs are not assigned to the controller automatically with ActionController::Metal self.cache_store = Rails.configuration.cache_store + self.perform_caching = ActionController::Base.perform_caching # ActionController::Caching asks for a controller's layout, but they're not used in the API layout false