Include Store in ControllerHelpers.
Set missing credit card attributes when possible. Fixes #4972
API Orders#show should only return the order json. Fixes #4979
Use prepend_before_filter to try calling before apply_coupon_code. refs #4926
Switch to cancancan to fix issues with custom abilities being unable to properly initialize sprees namespaced models.
Lookup order based on user_id to prevent started orders from showing after logout. Fixes #4940
Fix specs for i18n changes. Fixes #4998
Added missing translation for back_to_shipping_categories_list

Fixes #4993
Do not blindly accept just any month for CreditCard expiry

Fixes #4971
Silence two warnings

Fixes #4985

Silences this:

    [WARNING] You are not setting Devise.secret_key within your application!
    You must set this in config/initializers/devise.rb. Here's an example:

And this:

    [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.

in the sandbox app.
Added localization for multiple SKU info

Fixes #4994
Validate price maximum.

Price is constrained to be precision: 8, scale: 2 at the database level,
but that validation isn't reflected in the model.

This will lead to errors when prices are 1,000,000 or above, which is a
lot in USD, but 1 million Vietnamese Dongs is less than $50 USD.

Fixes #4944
Disassociate inventory units when a ReturnAuthorization is destroyed

Avoid leaving the inventory units in a bad state.

Fixes #4935
Undo change to current_example.
Revert "Use prepend_before_filter to try calling before apply_coupon_code. refs #4926"

This reverts commit 4c2f3618358feb5f1a160f1522580ee02a52eb24.
Change price * quantity to amount.

This is defined within line_item. It simplifies the code a little bit,
plus now it has API compatibility with orders. This should hopefully
allow us to remove some of the 3 percent off calculators that do almost
exactly the same thing...

Re-factor flat_percent_item_total.

The data here is now always a BigDecimal.

- The preference returned is a BigDecimal so it doesn't need to be
  converted to a string, and then back to BigDecimal
- Big Decimal provides round, so we don't need to convert to a float,
  round and then go back.

Extract quantity to it's own function.

Quantity is used by some of the calculators, and this will maintain
compatibility between calculators for use on both LineItems and Orders.

It also simplifies some of the code!

Add calcuators to LineItem adjustments.

With some minor modifications these calculators now work with line items
as well as whole orders.  This will allow store owners to set up
discounts of a specified amount on a product or set of products, rather
than only percentage discounts.

Fixes #5007

Conflicts:
	core/spec/models/spree/order_spec.rb
Improvements to API performance.

Refactor BaseController#product_scope to allow subclasses
to override the associations that are eager-loaded from a product.
In doing so, removed two associations that were eager-loaded
but never referenced (product.properties, variant.prices).

In Product#total_on_hand, don't load and instantiate all the
variants if all we need to know is whether any of them
track inventory. And don't load all the stock_items to sum their
counts on hand.  (Fix to 368b89786).

Fixes #5008
More code coverage.
Reduce the number of cascading touches.

For better performance when saving a product with many variants,
don't call `touch` when not necessary.

* After saving a product, but neither the product nor its
  default price changed, don't touch it.
* After saving a stock item, only touch the variants if the stock
  item changed.

Background: in ActiveRecord, if a product has not changed,
product.save will not write to the DB--but it *will* fire
the `after_save` callback. In that case there is no need to
touch anything.

Also factored out a method in variant.rb.

Fixes #5009
Fix simple_current_order to not conflict with order.
Fixes #4611