阅读背景:

为什么这个has_many与依赖关联:: destroy只破坏连接模型?

来源:互联网 

I have the following classes:

我有以下课程:

class Foo < ActiveRecord::Base
  has_many :bar_connectors
  has_many :bars, through: :bar_connectors, dependent: :destroy
end

class Bar < ActiveRecord::Base
  has_many :bar_connectors, dependent: :destroy
end

class BarConnectors < ActiveRecord::Base
  belongs_to :bar
end
class



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: