Displaying 1 result from an estimated 1 matches for "deal_count".
2006 May 22
3
STI, HABTM & counter_cache
...eresting issue that the online docs aren''t helping me with.
In my app I have 4 models
Item < ActiveRecord
Deal < Item
Product < Item
Category < ActiveRecord
Item has_and_belongs_to_many :categories...
On each category record I''d like to maintain a product_count and deal_count
to increase performance. This doesn''t appear possible with the current
"counter_cache" declaration.
Anyone have ideas on how to approach this?
In the past I''ve just run an hourly cron task to calculate & update all
records of this type, but I feel this probably isn...