(Memcached version: memcached 1.2.1, Rails 1.2.3, cache_fu r269
When doing Model.get_cache (1,2,3,4) cache_fu will cause a backtrace:
Item.get_cache(640,650)
RuntimeError: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/symbol.rb:10:in `__send__'
from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/symbol.rb:10:in `to_proc'
from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/enumerable.rb:57:in `index_by'
from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/multibyte/chars.rb:46:in `inject'
from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/enumerable.rb:56:in `each'
from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/enumerable.rb:56:in `inject'
from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/enumerable.rb:56:in `index_by'
from ./script/../config/../config/../vendor/plugins/cache_fu/lib/acts_as_cached/cache_methods.rb:60:in `get_caches'
from ./script/../config/../config/../vendor/plugins/cache_fu/lib/acts_as_cached/cache_methods.rb:24:in `get_cache'
from (irb):2
This is because hits cache looks like this:
{"Item:650"=>nil, "Item:640"=>nil}
They should be misses.
This patch works for me: http://pastie.caboo.se/71247 and all tests pass.