class User < ActiveRecord::Base has_many :likes has_many :liked_things, :through => :likes end
class Thing < ActiveRecord::Base has_many :likes has_many :liked_by_users, :through => :likes end class Like < ActiveRecord::Base belongs_to :user belongs_to :shot end This is my setup, and I have a `likes_count` column on Things Table. Is there any way to keep that count updating using counter_cache ? I got it working counter_cache on has_many association but failing to do same with has_many through association. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b1fc2e26-ebfe-448a-8f40-61d0b7523e13%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

