cache_counter for habtm
- by piemesons
Hello How can use cache_counter in a habtm. For example a question has many tags and a tag can belong to many questions.
question habtm tags
Now i want to find out number of questions belonging to every tag. One way is counting everytime.
But, in case of one_to_many i done same thing in this way.
Like one question has many answers. then in answer model i specified
belongs_to :question,:cache_counter=>true
It solved my problem. So how to do the same in habtm.