This project is archived and is in readonly mode.

#514 ✓resolved
Rob Anderton

Rails::Configuration default_cache_store not called

Reported by Rob Anderton | June 30th, 2008 @ 11:52 AM | in 2.x

The Rails::Configuration class initialize method does not call the default_cache_store method to assign a default value to the cache_store attribute.

If no cache store is explicitly configured then later, when the global cache is actually initialised (in the initialize_cache method of Rails::Initializer) and because the configuration.cache_store attribute is nil, then the default cache store is always a MemoryStore regardless of whether or not the tmp/cache directory exists.

Comments and changes to this ticket

  • Karel Minařík

    Karel Minařík August 19th, 2008 @ 10:23 AM

    • Tag changed from activesupport, bug, railties to 2.1, activesupport, bug, railties

    +1

    I recently run into this issue, because Rails 2.1 kept storing my cache in memory, instead of tmp/cache and I had to debug extensively.

    (I wanted to preserve cache content between deploys on a particular ActiveResource-based application. No need to flush precious cached content because of some minor change in CSS, better done with precision aim of Cap/Rake task).

  • josh

    josh November 22nd, 2008 @ 06:58 PM

    • State changed from “new” to “resolved”

    Looks like this was added.

    
        def initialize_cache
          unless defined?(RAILS_CACHE)
            silence_warnings { Object.const_set "RAILS_CACHE", ActiveSupport::Cache.lookup_store(configuration.cache_store) }
          end
        end
    

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages