Now that we managed to run the
spec/models/spree/order_spec.rb on our spree 2.0 branch, it turns out that few changes in the
Order model affect us.
Now orders have many shipments instead of a single
shipping_method. However the
shipping_method_id column hasn’t been removed from the
spree_orders table, at least until Spree’s
3-0-stable. Check out https://github.com/spree/spree/blob/master/frontend/app/views/spree/shared/_order_details.html.erb#L17 and https://github.com/spree/spree/commit/1cc4680#diff-434de9976fbb9c7d9358f1cb3d401019L51
This means that now the information of the shipment method lies in each of the particular shipments the order has.
#shipping_address_from_distributor makes use of
ShippingMethod#require_ship_address. It turns out that is a column that we added to the
spree_shipping_methods table 20140213003443_add_require_ship_address_to_shipping_methods.rb.
Said column is populated when creating a new shipping method as an admin (choosing
pick up sends it to false). When set, the shipping section of the checkout form shows the
Likewise, the checkout flow also checks whether the shipping method requires an address (using
ShippingMethod#require_ship_address) and if it is set it creates a shipment in the order object.
Due to now having many shipments, spree removed
Order#create_shipment!. It doesn’t make sense anymore. Checkout the commit for more details.
NOTE: why do we access the
payment state (haven’t checked the others) 8 times?
These are the links to specific threads, GitHub issues and PRs required for the upgrade of the Order model: