dependent => destroy on a “has_many through” association
问题 Apparently dependent => destroy is ignored when also using the :through option. So I have this... class Comment < ActiveRecord::Base has_many :comment_users, :dependent => :destroy has_many :users, :through => :comment_users ... end ...but deleting a Comment does not result in the associated comment_user records getting deleted. What's the recommended approach, then, for cascade deletes when using :through? Thanks 回答1: Apparently :dependent is not ignored! The real issue was that I was