The has and belongs to many association

suggest change

A has_and_belongs_to_many association creates a direct many-to-many connection with another model, with no intervening model.

For example, if your application includes assemblies and parts, with each assembly having many parts and each part appearing in many assemblies, you could declare the models this way:

class Assembly < ApplicationRecord
  has_and_belongs_to_many :parts
end
class Part < ApplicationRecord
  has_and_belongs_to_many :assemblies
end

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


ActiveRecord Associations:
*The has and belongs to many association

Table Of Contents
10ActiveRecord Associations
55CSV