I wanted to know if it is possible to make several updates and creations in rails within a single transaction.
I wanted to create no. from Productsfrom any array. But for every product I also need to create Companyand Categoryfor him.
So the idea is this:
//create a company
//create a category
while product_list
{
//create a product with company and category created above
}
So, if any of the creations fails, I want the previous updates / creations to be rolled back.
source
share