HABTM 关系不支持 :dependent
是真的吗?选项?
class Person < ActiveRecord::Base
has_and_belongs_to_many :posts, :dependent => :destroy
end
我正在尝试 rails 边缘。
最佳答案
是的,它不支持它。 See the docs .一般habtm
仅适用于非常非常简单的情况,如果您开始需要更复杂的东西,您应该切换到 has_many :through
.
关于ruby-on-rails - habtm 关系不支持 :dependent option,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2799746/