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?