From 32b85a0aaeb7f113d6b55248cf6e37a8087147ee Mon Sep 17 00:00:00 2001 From: Nahuel Cuesta Luengo Date: Wed, 30 Mar 2016 21:33:09 -0300 Subject: [PATCH] Make cache_store reference explicit This avoids an issue when the base class for application's controllers inherit from `ActionController::API` instead of `ActionController::Base`. --- lib/active_model_serializers/railtie.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_model_serializers/railtie.rb b/lib/active_model_serializers/railtie.rb index 1c8ff3c9..971393fe 100644 --- a/lib/active_model_serializers/railtie.rb +++ b/lib/active_model_serializers/railtie.rb @@ -28,7 +28,7 @@ module ActiveModelSerializers ActiveModelSerializers.config.perform_caching = Rails.configuration.action_controller.perform_caching # We want this hook to run after the config has been set, even if ActionController has already loaded. ActiveSupport.on_load(:action_controller) do - ActiveModelSerializers.config.cache_store = cache_store + ActiveModelSerializers.config.cache_store = ActionController::Base.cache_store end end