Ruby on rails 与单表继承的多对多关联

Ruby on rails 与单表继承的多对多关联,ruby-on-rails,ruby,ruby-on-rails-4,single-table-inheritance,Ruby On Rails,Ruby,Ruby On Rails 4,Single Table Inheritance,我正在寻找儿童模型中的多对多关联。下面是这样的。你能告诉我最好的方法是什么吗 家长 class A < ActiveRecord::Base end class B < A has_many :bc has_many :c ,through: :bc end class C < A has_many :bc has_many :b, through: :bc end Child2 class A < ActiveRecord::Bas

我正在寻找儿童模型中的多对多关联。下面是这样的。你能告诉我最好的方法是什么吗

家长

class A < ActiveRecord::Base
end
class B < A
  has_many :bc
  has_many :c ,through: :bc
end
  class C < A
    has_many :bc
    has_many :b, through: :bc
  end
Child2

class A < ActiveRecord::Base
end
class B < A
  has_many :bc
  has_many :c ,through: :bc
end
  class C < A
    has_many :bc
    has_many :b, through: :bc
  end
C类
如果您不需要额外的列,那么您只需使用has\u和\u-belish\u-to\u许多您可以从中阅读的内容

使用父母和孩子的单一模型对您不起作用?我的意思是,你必须使用3种型号吗?是的,我必须使用3种型号,限制