camerican / Help-Desk

Help Desk for NYCDA Projects
1 stars 1 forks source link

on previous assignment, need to figure out params for factory ingredients #19

Closed Rappole4 closed 7 years ago

Rappole4 commented 7 years ago

1 error prohibited this factory from being saved: Ingredient must exist

camerican commented 7 years ago

We were able to determine that the error here was being caused because we're passing through an array of ingredients and must therefore sequentially add in separate "factories" to the database. The name factory is very misleading in this project, since it's a join table for the many-to-many relationship between sauces and ingredients and 'factory', as a noun, does not convey this meaning.

Nevertheless, from the factories#create action we're able to declare a transaction, iterate over all ingredients, and create new 'factories' with the ingredient and sauce ids.