counter_cache not decrementing for has_many associations in ActiveReord
问题 My Rails 3 app has 2 models and a third that's join table between them and their has_many relationships. Basically, User and Show are joined by SavedShow, allowing users to save a list of shows: class Show < ActiveRecord::Base has_many :saved_shows has_many :users, :through => :saved_shows end class User < ActiveRecord::Base has_many :saved_shows has_many :shows, :through => :saved_shows end class SavedShow < ActiveRecord::Base belongs_to :user, :counter_cache => :saved_shows_count belongs_to