nkallen / cache-money

A Write-Through Cacheing Library for ActiveRecord
Apache License 2.0
994 stars 107 forks source link

seem like endless loop when index [:id,:state] #21

Open huacnlee opened 14 years ago

huacnlee commented 14 years ago

Hello: I had a model name's Place, and it have a state field. I was defined the default_scope for all with state = 1 class Place < ActiveRecord::base index [:id,:state] default_scope :conditions=> [:state => 1] end

when I was used Place.find(278) First was success, but there output NOT_STORED on Memcached console. Again it Place.find(278), the Memcached well be endless loop : <1872 get Place:1/id/278/state/1

1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1 1872 END <1872 get Place:1/id/278 1872 END <1872 get Place:1/id/278/state/1 1872 sending key Place:1/id/278/state/1

Why?