Ruby on Rails 6.0.2.1
Module ActiveRecord::Associations::ClassMethods

Associations are a set of macro-like class methods for tying objects together through foreign keys. They express relationships like “Project has one Project Manager” or “Project belongs to a Portfolio”. Each macro adds a number of methods to the class which are specialized according to the collection or association symbol and the options hash. It works much the same way as Ruby’s own attr* methods.

class Project < ActiveRecord::Base belongs_to :portfolio has_one :project_manager has_many :milestones has_and_belongs_to_many :categories end

from: ActiveRecord::Associations::ClassMethods

more info: has_many (ActiveRecord::Associations::ClassMethods) - APIdock