对于第 12 章的练习 1,我无法弄清楚为什么当我从 User 模型中取出 :dependent => :destroy 时我的测试没有失败
我的测试
@user.follow!(@followed)
@followed.destroy
@user.followers.should_not include(@followed)
我的模型,没有 :dependent => :destroy
has_many :relationships,
:foreign_key => "follower_id"
has_many :following, :through => :relationships, :source => :followed
has_many :reverse_relationships,
:foreign_key => "followed_id"
:class_name => "Relationship"
has_many :followers, :through => :reverse_relationships, :source => :follower
仍然导致所有测试通过