j-sm-n / black_thursday

Black Thursday is a system that is able to load, parse, search, and execute business intelligence queries against the data from a typical e-commerece business in Ruby.
0 stars 0 forks source link

Relationships - invoice.merchant #36

Closed jesse-spevack closed 8 years ago

jesse-spevack commented 8 years ago

Then connect our invoices to our merchants:

se = SalesEngine.from_csv({ :items => "./data/items.csv", :merchants => "./data/merchants.csv", :invoices => "./data/invoices.csv" }) merchant = se.merchants.find_by_id(10) merchant.invoices

=> [, , ]

invoice = se.invoices.find_by_id(20) invoice.merchant

=>

https://github.com/turingschool/curriculum/blob/master/source/projects/black_thursday/iteration_2.markdown#relationships