paint-brush
Debugging Has_Many, Through Relationships in Ruby on Railsby@scrabill
831 reads
831 reads

Debugging Has_Many, Through Relationships in Ruby on Rails

by Shannon5mFebruary 2nd, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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.

Company Mentioned

Mention Thumbnail
featured image - Debugging Has_Many, Through Relationships in Ruby on Rails
Shannon HackerNoon profile picture
Shannon

Shannon

@scrabill

Front End Software Engineer

L O A D I N G
. . . comments & more!

About Author

Shannon HackerNoon profile picture
Shannon@scrabill
Front End Software Engineer

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here