CachedModel looks like a great idea. Thanks for contributing it.
Do you have to have all of your models derived from CachedModel and
running through the cache? Or
can I do only selective ones (hopefully)?
I tried just switching one model over to CachedModel, and I get an
‘undefined class/module’ error
on another model. But that’s the User model, which is stored in the
session. I didn’t think I was
caching sessions using memcached, but maybe I am…
/usr/lib/ruby/gems/1.8/gems/memcache-client-1.0.3/lib/memcache.rb:128:in
get' ... /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session/mem_cache_store.rb:59:in
restore’
/usr/lib/ruby/1.8/cgi/session.rb:305:in []' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/cgi_process.rb:104:in
session’
…
Looks like it is correctly finding the user, logging the user in, and
writing a last login time to
the database. But then it redirects and tries to pull the user object
out of the session and
fails. Does CachedModel / memcache-client conflict with session storage?
So maybe this is a session problem? Or is it having a problem
instantiating the User object pulled
out of the cache when User is derived from ActiveRecord::Base, not
CachedModel?
Thanks,
KW