【发布时间】:2010-11-26 19:55:17
【问题描述】:
显然依赖 => 当同时使用 :through 选项时会忽略destroy。
所以我有这个...
class Comment < ActiveRecord::Base
has_many :comment_users, :dependent => :destroy
has_many :users, :through => :comment_users
...
end
...但删除评论不会导致关联的 comment_user 记录被删除。
那么,对于使用 :through 时的级联删除,推荐的方法是什么?
谢谢
【问题讨论】:
标签: ruby-on-rails activerecord has-many-through