spree/spree — pull request #4102 by dkubb (2013-12-11 23:44:50+00:00)
Title: Fix available package shipping methods

This branch fixes the package shipping methods to only return the shipping methods that are *common* to all the shipping categories. The current code returns *all* the shipping methods, even those that may not apply to a product.

Typically this isn't noticeable since `Spree::Stock::Splitter::ShippingCategory` is enabled by default, and splits up the package into separate packages grouped by the shipping category. However, when this is not used then the package can potentially return invalid shipping methods.

This also adds a unique constraint to the table used by `Spree::ShippingMethodCategory` that ensures the join record is only recorded once. The migration will also remove any duplicate records before applying the uniqueness constraint.