I’ve successfully set up memcache client in my Rails app. However, when
I put something into the cache in one controller, and then attempt to
retrieve it in another controller, I get an error.
More detail:
In ListManagementController, I place the item in the cache - by using
the fact that a missing key will put the result of the block into the
cache:
SOLUTION: Add “model” calls to the appropriate controllers that would be
involved in pulling these objects from the cache. This will ensure that
the appropriate class definitions are available when the unmarshaling is
done.
Use
model :target_list, :target, :job
to handle the TargetList, Target, and Job classes.
In my case, I chose to add the model call to application.rb, since
multiple controllers pull my objects from the cache.
Wes
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.