crowdint/acts_as_shopping_cart — pull request #3 by abatko (2012-02-29 03:46:31+00:00)
Title: adding non-cumulative capability to cart.add

I needed a way to add items such that the final quantity is equal to the amount specified in the `add` method, not the cumulative quantity of that and what is already stored in the db.

This capability is provided by a boolean fourth parameter, called `cumulative`. By default the method will behave as you initially coded it (because by default `cumulative` is set to `true`); however by passing `false`, `cart_item.quantity` will not be included.

I also added tests.