views:

254

answers:

2

I recently installed cache-money. After some difficulties getting memcached and cache-money set up, I thought I had it working. It cached the one query on my login page fine. I login, and go to my message index page and get this error:

indices delegated to @cache_config.indices, but @cache_config is nil: Slug(id: integer, name: string, sluggable_id: integer, sequence: integer, sluggable_type: string, scope: string, created_at: datetime)

Searching for the first part of that error message returns 0 hits on Google, so I'm at a loss on where to even begin. Any suggestions?

+1  A: 

I think you may have missed setting an index in your Message model. Cache Money will work automatically for fields like id, but otherwise you need to set them yourself.

class Message < ActiveRecord::Base
  index [:subject, :body, :sender]
end
Mike Buckbee
To clarify, what do I do with models that I don't want indexed? Or is there a way to specify only certain files for caching?
Matt Grande
"Indexed" in this context just means: field that I will be querying on. If you aren't going to query on a model, don't put in the index settings in it.
Mike Buckbee
Hmm, the problem is I haven't indexed it...I have is_cached :repository => $cache in my cache_money.rb file. Do I need to move it elsewhere?
Matt Grande
A: 

2 weeks ago the friendly_id side recognized this issue and closed it to fix first by the cache-money side before playing with friendly_id:

http://github.com/norman/friendly_id/issues/closed#issue/33

So you have to do without one of the 2 plugins for the time being.

Murdoch