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`.
This commit is contained in:
Nahuel Cuesta Luengo 2016-03-30 21:33:09 -03:00
parent 27a5de262f
commit 32b85a0aae

View File

@ -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