I have model with tag context:
class Product < ActiveRecord::Base
acts_as_taggable_on :categories
end
I'm trying to initialize tags caching:
class AddCachedCategoryListToProducts < ActiveRecord::Migration
def self.up
add_column :products, :cached_category_list, :string
Product.reset_column_information
products = Product.all
products.each { |p| p.save_cached_tag_list }
end
end
But cached_category_list
does not initializing. What I'm doing wrong? Does anybody can use caching with this gem (my version is 2.0.6)?
p.save_cached_tag_list
as that will be called by the before_save hook. – Arthralgia