Rails counter cache

Let's say you have an application similar to Twitter where you have Users and Tweets and User 'has_many' tweets and Tweet 'belongs_to' user and you want to display how many Tweets a User has or how many people follow his Tweets. Typically, what you would do is query users and count their Tweets in by … Continue reading Rails counter cache

Advertisements