Debugging Has_Many, Through Relationships in Ruby on Rails

Written by scrabill | Published 2020/02/02
Tech Story Tags: ruby-on-rails | active-record | debugging | ruby | programming | database | software-development | tutorial

TLDR A mock Central Perk, Ruby on Ruby on Rails application, has many-to-many relationships. The relationship between Users (baristas), Orders and Menu Items (products) is where it got weird. An Order with an attribute of 'Many to Many' could only have one value per Order. An order, which belongs to a user, could have many Menu Items. An order could have more than one Menu Item, per Order. An Order would essentially be a collection of all OrderRecords with the same order_id. But, through other associations, it extends the functionality of those models.via the TL;DR App

no story

Written by scrabill | Front End Software Engineer
Published by HackerNoon on 2020/02/02