small medium large xlarge

10 Dec 2013, 09:58
Tuomas Martikainen (1 post)


I am wondering why the combine_items_in_cart migration is needed?

When I add items to the cart before generating the combine_items_in_cart migration, they show up just fine in the cart and database. I checked this with rails console, the quantity is +1 for each line item when added to cart without creating another line item. like this * 2 xCoffeescript * 1 another book * …


05 Feb 2014, 03:21
Dennis Sutch (13 posts)

The migration is required for instances where multiple duplicate items were added before the quantity was added to line_items. If you had two separate line_items that each had Coffeescript before the quantity was added, the cart would end up with two separate line_items for Coffeescript–one having a quantity of 1 and the other with 1 + however many were added after the quantity enhancement.

20 Jun 2014, 16:36


I am wondering about the same question. Should I understand that the migration is a ‘safety’ migration, because in production the code will be complete?

Great book!


You must be logged in to comment