Closed jesse-spevack closed 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
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