ngmoco / cache-money

A Write-Through Cacheing Library for ActiveRecord
Apache License 2.0
161 stars 31 forks source link

Memcache compatability #9

Closed betamatt closed 13 years ago

betamatt commented 13 years ago

There are a couple compatibility issues betwen memcache-client and memcached.

  1. Checking for a default ttl calls repository.default_ttl, which only eixsts in Memcached. The value should be timeout for MemCache. Since timeout is often conflicts and won't get passed by missing_method, I monkey patched an alias for default_ttl.
  2. The wrapper checks for MemCache before Memcached meaning that if both are defined, and such is often the case since Rails bundles memcache-client, then the wrong one gets used. I reversed the order of the check so that Memcached is preferred when present.
betamatt commented 13 years ago

I'm braindead today. I confused the default ttl with the socket timeout. When using memcache-client there should be no attempt to read a default ttl and instead cache-money's default should be used. Will fix.

ashleym1972 commented 13 years ago

Fixed already.

ashleym1972 commented 13 years ago

Pulled. I like your code more.

ashleym1972 commented 13 years ago

New gem version published.