Restrict rails to 4.0.9
Merge pull request #100 from bonobos/rails-version

Restrict rails to 4.0.9
Don't raise an error on credit card default setting of another card is expired
Revert "Restrict rails to 4.0.9"

This reverts commit c4d23312df7eca8978d2a07fc1db0778954520b7.
Cherry-picked from 2-2-dev 98f73f5915efcb2caaa1f878e9abdc17bf02c340

RSpec 3.1 support & Fix a couple Rails 4.0.10 regressions.

Conflicts:
	api/spec/controllers/spree/api/orders_controller_spec.rb
	cmd/lib/spree_cmd/templates/extension/extension.gemspec
	common_spree_dependencies.rb
	core/spec/lib/spree/core/controller_helpers/auth_spec.rb
	core/spec/lib/spree/core/controller_helpers/order_spec.rb
	core/spec/models/spree/credit_card_spec.rb
	core/spec/models/spree/order/finalizing_spec.rb
	core/spec/models/spree/order/payment_spec.rb
	core/spec/models/spree/order/risk_assessment_spec.rb
	core/spec/models/spree/order_spec.rb
	core/spec/models/spree/payment_spec.rb
	core/spec/models/spree/preferences/store_spec.rb
	core/spec/models/spree/store_spec.rb
	frontend/spec/controllers/controller_helpers_spec.rb

Conflicts:
	common_spree_dependencies.rb
	core/spec/models/spree/credit_card_spec.rb
	core/spec/models/spree/payment_spec.rb
	core/spec/models/spree/return_authorization_spec.rb
	frontend/spec/spec_helper.rb
Merge pull request #99 from bonobos/default-card-validations

Don't raise an error on credit card default setting of another card is expired
Implement cart and shipment steps in order admin

Fix line item proper currency check

This resolves #5132. The admin manual order cart is much more like the frontend now in that you start off by adding items to the cart(line items). You then add an address, the shipments are calculated based on the frontend rules you have set up but you as an admin can ignore those rules and muck with the shipments on the Shipments tab. You can also skip adding items to the cart altogether by just entering an address and then adding shipments manually, the way the old backend admin did before this patch.

Removing unnecessary code for getting the total_on_hand for a variant through the API

Extracting the advanceOrder function into a function in the Spree namespace so that both the shipmentsJS and line_itemsJS can share it

Advancing the order after we add variants on the cart page. If we have already created shipments, then when we edit a line item the order gets reset to the address state. This call pushes it back to the payment state and destroys the old shipments, recreating them to match the new line item state.

In checkout.rb we first create_proposed_shipments but here we check if addresses are valid. If not we need to destroy_all instead of delete_all so that the inventory_units that were created by create_propsed_shipments will also be destroyed and not clutter up the DB

Fixing the Split tool. IF success we reload the page, else display a generic error. Would like to in the future provide more specific errors. Not allowing splits to the same shipment nor to a shipment or location that does not have the stock and is NOT backorderable. Next commit will have a boatload of automated tests.

Updating my admin changes in master to be compat with spree-2-3

Conflicts:
	api/app/controllers/spree/api/line_items_controller.rb
	api/app/controllers/spree/api/shipments_controller.rb
	api/app/controllers/spree/api/variants_controller.rb
	api/config/routes.rb
	backend/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee.erb
	backend/app/controllers/spree/admin/orders_controller.rb
	backend/app/views/spree/admin/orders/edit.html.erb
	backend/spec/controllers/spree/admin/orders_controller_spec.rb
	backend/spec/features/admin/orders/new_order_spec.rb
	backend/spec/features/admin/orders/order_details_spec.rb
	core/app/models/spree/line_item.rb
	core/app/models/spree/order.rb
	core/app/models/spree/shipment.rb

Change-Id: I2f15c34e7b5b79f1a2dc015c05bccf3fd1b46df6

Cleanup of #5166

Don't rescue exceptions

order shipments in admin by created_at

Raise an exception if an item can't be added

Previously this could fail silently without adding an item to the order.

Remove unnecessary stock check

If stock is unavailable an error will be triggered anyways rolling back
the transaction.

api/shipments: simplify load_transfer_params

Use transfer_to_shipment from transfer_to_location

Conflicts:
	core/app/models/spree/shipment.rb

Change-Id: I8591ac0415bbf2dc4464a2ca377dccc96b470da4

remove duplicate, non-js variant autocomplete

the coffee one has all the templates we want
Update specs from rails 4.0.10 regression fixes to make them pass
Merge pull request #101 from bonobos/fix-4-0-10-regressions

Fix 4.0.10 regressions
Allow disabling Spree Frontend

(NOTE: We're debating the best long-term solution for this over [here](https://github.com/spree/spree/pull/5360) but I didn't want that to block us right now from moving forward.  My hope is we'll find the best solution over there and then we can revert this if needed and pull in whatever gets into spree master)

Via a config preference.

We use our own frontend along with spree-api and this change will allow us to easily disable the frontend on our prod boxes yet keep it enabled for development so that we can test that our spree changes are meshing well with spree frontend code.

We can also try to make sure that we prevent requests at the nginx layer, but this seems like a nice way to make sure we really close off access to frontend so that we never end up with customers accidentally hitting frontend endpoints and getting really confused.  Setting up a config will also allow other extensions (like spree_auth_devise) to read the same setting.

Conflicts:
	frontend/app/controllers/spree/store_controller.rb