Database

Latest Posts

Convert a belongs_to Association to a has_many :through Association in Ruby on Rails

I was tasked with converting a belongs_to association to a has_many :through association. The challenge was that the app was live, and there were existing relationships. I was able to convert the belongs_to association to a has_many :through association while still maintaining existing relationships by creating a custom migration file, and updating the existing models.

Read More