spree/spree — pull request #3555 by RohanM (2013-08-13 01:17:31+00:00)
Title: Calculators work against LineItems

Presently, if you try to make adjustments that are calculated against individual line items, the calculators provided by Spree fail because they are designed to be run against Orders (with the exception of DefaultTax). This pull request makes them more flexible so that they can run against either Orders or LineItems.

Known issues:

The FlatRate calculator is labelled "Flat Rate (per order)". In this pull request, I've made the FlatRate calculator compatible with a line item input, but it seems to me like an unnatural pairing, and there is some unintuitive behaviour that results. Perhaps it'd be less confusing to not allow the calculator to work with line items in the first place.