Why rails give us two methods to config rails cache_store?
I found there are two methods to config cache_store
:
config.action_controller.cache_store = :mem_cache_store, "localhost"
here is doc
and:
config.cache_store = :mem_cache_store, "localhost"
It s开发者_运维问答eems that they are same thing.
Why rails give us two methods to config cache store? Is there any thing different?
Those values that you set in config.cache_store are used in config.action_controller.cache_store
The shorter version is simply easy to write out and remember. See the rails source that demonstrates this at: https://github.com/rails/rails/blob/v3.0.7/actionpack/lib/action_controller/caching.rb#L44
精彩评论