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.