10 Dec 2013, 09:58
Generic-user-small

Tuomas Martikainen (1 post)

Hi!

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 * …

-Tuomas

05 Feb 2014, 03:21
Generic-user-small

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.

  You must be logged in to comment