ActsAsCached::MarshalError.

0 views
Skip to first unread message

Dmitrij Smalko

unread,
Apr 18, 2008, 10:54:21 AM4/18/08
to acts_as_cached
Hi!

I have a problem:

class Category < ActiveRecord::Base
acts_as_cached

after_save :set_cache

has_many :tracks
end

class Track < ActiveRecord::Base
acts_as_cached

after_save :set_cache

belongs_to :category


alias :category_without_cache :category

def category
Category.get_cache(category_id) { category_without_cache }
end
end

When I call @track.category an error occurs:

ActsAsCached::MarshalError..
Most likely an association callback defined with a Proc is triggered,
see http://ar.rubyonrails.com/classes/ActiveRecord/Associations/ClassMeth...
(Association Callbacks) for details on converting this to a method
based callback

How to fix it?
Reply all
Reply to author
Forward
0 new messages