0

I am looking for a many-to-many association within the child models. Something like this below. Can you please guide what's the best way to do it.

Parent

class A < ActiveRecord::Base
end

Child1

class B < A
  has_many :bc
  has_many :c ,through: :bc
end

Child2

  class C < A
    has_many :bc
    has_many :b, through: :bc
  end
AnkitG
  • 6,438
  • 7
  • 44
  • 72

1 Answers1

0

if you don't need extra columns, then you just use has_and_belongs_to_many you can read it from http://guides.rubyonrails.org/association_basics.html

HarsHarI
  • 901
  • 4
  • 11