has_one/has_many with dependent destroy but using a different name for the key
问题 So I'm looking at someone's code which has the following (paraphrased): class user has_one :connection, :dependent => :destroy has_one :second_user, :through => :connection, :class_name => 'User' end class connection belongs_to :user belongs_to :second_user, :class => 'User' end If I have a connection object and delete the associated 'user' it can be destroyed fine. But I also want to make it so that if the User occupying the 'second_user' field is destroyed the connection is destroyed. How