This project is archived and is in readonly mode.
Type error in ActiveSupport::Cache::Store documentation. Section fetch.
Reported by Igor Galeta | November 25th, 2010 @ 09:27 AM
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".
Comments and changes to this ticket
-
Neeraj Singh November 25th, 2010 @ 10:27 PM
- 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.
-
Aditya Sanghi November 27th, 2010 @ 09:51 AM
- State changed from new to resolved
- Tag set to documentation
Committed in docrails. Closing.
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>