Become a Rails Association Pro: Replicating has_many with Pure Ruby

Gokul
4 min readMay 6

Understanding the has_many Association

In Ruby on Rails, the has_many association is used to define a one-to-many relationship between two models. It allows us to easily access a collection of associated records for a particular record. This association is one of the most commonly used in Rails applications.