Is it possible to use counter cache on a habtm relation in rails 3 ?
I really need it to speed up my application.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no built in method for
HABTMbut it is simple to make your own counter cache (actually I was doing it many times before I’ve inventedcounter_cache.Or use
has_many :throughtinstead ofHABTMassociation. I never useHABTMbecause it looks awkward for me.Related topic: