Avoid name clashing when including modules
Wait ajax request a bit for backend spec fix
Refactor ensure_updated_shipments call to be within the OrderContents and OrderPopulator classes to ensure consistency. Fixes #5082

Conflicts:
	api/app/controllers/spree/api/line_items_controller.rb
Validate uniqueness of order numbers... Why was this FIXME never fixed until now... Fixes #5102
changed generate_order_number method for insure that generated numbers never finish #5102
Fix broken specs from order number refactoring, and improve performance. Fixes #5102
Fix payment state in order importer. Fixes #5109

Conflicts:
	core/lib/spree/core/importer/order.rb
Use rand(10) to cover all digits 0-9. Fixes #5113
Calculate tax total correctly which depends on the item that could be an Order or a LineItem. Tax adjustments are stored differently in these two cases.

Fixes #4830
Fixes #4829
Speed up rename_adjustment_fields migration

I went to perform this migration on our production db while our store was in maintenance mode and realized it was going to take many hours -- it was loading some million or so Order objects, one at a time.

The first change is that we go from loading all Adjustments and asking whether their adjustable is an Order to just scoping the Adjustment call to only ask for the ones that are. That saved us about one million `if` statements.

The second change is to simply copy the `adjustable_id` over to `order_id` without ever fetching the Order -- who needs it? This saved us about one million ActiveRecord queries.

Happy to pass the fruits along to others on the 2.1--2.2 upgrade path!

Fixes #5121
Make Shipment.cost default to 0

Since upgrading to Spree 2.2, I've noticed exceptions getting thrown by, for instance [`cost + promo_cost`](https://github.com/spree/spree/blob/2-2-stable/core/app/models/spree/shipment.rb#L151) throwing `NoMethodError: undefined method `+' for nil:NilClass`.

Looking into my db schema, I see that virtually all decimal figures in Spree default to 0, but it looks like for some reason `spree_shipments.cost` didn't get that default. This migration helps ensure a smooth upgrade path from earlier Spree releases to 2.2.

Fixes #5128
Dont advance order state when adding an item to cart

As of d02f67dbbf7e8ae1f61b65066c2a3a8234796a11

Admin would click to add a item to the order which would create the line
item and shipment but because we advance the order to address state the
shipments would be destroyed Order#ensure_available_shipping_rates

Cant see why we needed advance order in the first place.
Add completed back as default state.
Update Google Analytics

Updates GA tracking code to support Display Advertising. See: https://support.google.com/analytics/answer/2444872 for more.

Fixes #5129
Allow assigning shipped_at to shipments.

Conflicts:
	core/spec/lib/spree/core/importer/order_spec.rb
Merge pull request #5101 from themetric/fix-api-custom-template

add missing respond_with to some API controllers and add tests
Merge pull request #4844 from woboinc/bugfix/avoid_name_clashing

Avoid name clashing when including modules
add validation to verify that count_on_hand of backorderable should not go negative if it is not backorderable

Fixes #3808
add a before_transition to verify if order is resumed only if there are no insufficient stock lines
Fixes #3819

Conflicts:
	core/app/models/spree/order/checkout.rb
Fix conflict.