Closed Rappole4 closed 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.
1 error prohibited this factory from being saved: Ingredient must exist