Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8763

Show
Ignore:
Timestamp:
02/01/08 01:33:42 (5 months ago)
Author:
bitsweat
Message:

cache.fetch(key, :force => true) to force a cache miss

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/CHANGELOG

    r8746 r8763  
    11*SVN* 
     2 
     3* cache.fetch(key, :force => true) to force a cache miss.  [Jeremy Kemper] 
    24 
    35* Support retrieving TimeZones with a Duration.  TimeZone[-28800] == TimeZone[-480.minutes].  [rick] 
  • trunk/activesupport/lib/active_support/cache.rb

    r8546 r8763  
    4848      end 
    4949 
    50       def fetch(key, options = nil) 
    51         @logger_off = true         
    52         if value = read(key, options) 
     50      # Pass :force => true to force a cache miss. 
     51      def fetch(key, options = {}) 
     52        @logger_off = true 
     53        if !options[:force] && value = read(key, options) 
    5354          @logger_off = false 
    5455          log("hit", key, options)