当使用:through选项时,显然依赖=> destroy被忽略.
所以我有这个......
class Comment < ActiveRecord::Base
has_many :comment_users, :dependent => :destroy
has_many :users, :through => :comment_users
...
end
Run Code Online (Sandbox Code Playgroud)
...但删除评论不会导致关联的comment_user记录被删除.
那么,当使用时,对于级联删除,推荐的方法是什么:通过?
谢谢