Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Type error in ActiveSupport::Cache::Store documentation. Section fetch.

#6063

On page http://api.rubyonrails.org/classes/ActiveSupport/Cache/Store.html type error in options for method fetch(name, options = nil):

Setting :expires_in ... :

 cache = ActiveSupport::Cache::MemoryStore.new(:expire_in => 5.minutes)
 cache.write(key, value, :expire_in => 1.minute)  # Set a lower value for one entry

In example settings must be "expires_in" not "expire_in".
Some code from mem_cache_store.rb:

 # Write an entry to the cache.
 def write_entry(key, entry, options) # :nodoc:
   method = options && options[:unless_exist] ? :add : :set
   value = options[:raw] ? entry.value.to_s : entry
   expires_in = options[:expires_in].to_i
   ...

Code use option "expires_in".

Reported by Igor Galeta · November 25th, 2010 @ 09:27 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Neeraj Singh
    Neeraj Singh
    • Importance changed from to Low

    Anyone can make change to documentation at https://github.com/lifo/docrails . Go ahead fix the changes and push it. Your changes will be merged soon.

    November 25th, 2010 @ 10:27 PM

  2. Aditya Sanghi
    Aditya Sanghi
    • State changed from new to resolved
    • Tag set to documentation

    Committed in docrails. Closing.

    November 27th, 2010 @ 09:51 AM

  3. af001
    af001

    私の中で、総合評価のとっても低いアバアバクロホリスタークロ銀座店。アバクロは大好きなんですけどね。一昨日の東京駅付近での打ち合わせの後、散歩がてら久々に行ってきました。そしたらビックリ!相変わらアバクロず、踊っているだけの店員さんとかもいましたが、

    May 5th, 2011 @ 02:57 AM