Summary

This is the official 1.1 Release of Spree. This is a minor release, and so backwards compatibility with extensions and applications is mostly guaranteed. There may still be some changes required for your extensions or applications, and so please read the changelog below to know if you are affected.

If any particular extension your store uses is not yet compatible you are encouraged to alert the Spree team about it by filing an issue on that extension project if it’s an official extension, or to submit a patch to that project to upgrade compatibility.

Major changes (backwards incompatibility)

Support for Rails 3.2.x only

Support for Rails 3.1.x is dropped. Rails 3.2.x offers performance boost in development mode and is the first-class supported platform for 1.1.x release cycles. It is recommended that you use the latest version 3.2.3. Please upgrade your Rails before bumping Spree gem by modifying your Gemfile:

gem 'rails', '3.2.3'
 group :assets do
     gem 'sass-rails', '~> 3.2.3'
     gem 'coffee-rails', '~> 3.2.1'
     gem 'uglifier', '>= 1.0.3'
     gem 'jquery-rails'
 end

ransack replaced meta_search

ransack replaced meta_search as the primary object-based searching mechanism. Be warned that ransack is not fully backward-compatible with meta_search query. Make sure you port and test all meta_search queries to ransack after upgrade.

spree_product_groups now as standalone extension

Product Groups component has been extracted to a standalone spree extension. It is recommended that if you are using this functionality to add the new extension to your Gemfile:

gem ‘spree_product_groups’, :git => ‘git@github.com:spree/spree_product_groups.git’

Old Theme Hook

theme_support files are now deprecated in favor of Deface. Make sure you port all your old style hooks to Deface.

Major rewrite of Creditcard model

Prior to 1.1, the Creditcard model contained a lot of payment processing code. This has since been moved into the Payment model. If you have customized the Spree::Admin::PaymentsController or depend on any of the payment processing methods inside the CreditCard model such as authorize, credit, or void, this change may affect you.

API rewrite

The API component of Spree has undergone a major rewrite in order to provide better support for applications wishing to interact with it using tools such as Backbone, or for people wishing to just generally access the individual components of Spree.

This is currently a work-in-progress and we would appreciate feedback on the API on the mailing list.

As a part of this, the spree/spree_api assets are no longer available, and so these should be removed from the store/all.css, store/all.js, store/admin/all.css and store/admin/all.js assets located in your application.

Minor changes

Introduce Spree::Product#master_images and Spree::Product#variant_images

Spree::Product#master_images and its alias Spree::Product#images only returns images belongs to master variant.

Spree::Product#variant_images behaviour is changed, it is no longer return only images belongs to master variants but now also include all variants’ images.

Stronger mass assignment protection

As per the Rails 3.2.3 release notes , there is a stronger enforcement of attribute protection within Rails. This may affect your Spree application, and if it does we would advise filing an issue so that it can be promptly fixed. While the tests for Spree itself are extensive, there may still be edge cases where your application goes that we do not have covered.

Removed images association of Spree::Product

Spree::Product association with viewable has been moved master variant of the product. The change is backward compatible and require no upgrade modification.

A call to the images method on a Spree::Product will return all the images associated with all the variants of this product. If you want just the master variant’s images, use product.master.images.

The version of Paperclip required by Spree 1.1 is now any version of the 2.7.x branch of Paperclip.

Clearer separation of Spree components

It was brought to our attention that the Core component of Spree depended upon things from other components, primarily Auth. The purpose of the Core component is that it should be usable in complete isolation from all other components of Spree. This feature was regressed during the 1..0 branch, but has now been fixed in the 1.1 branch.

From 1.1 onwards, you will once again be able to use the Core component of Spree in isolation from the other components if you choose so.

Allow for easier Spree controller spec testing

We have added a Spree::Core::TestingSupport::ControllerRequests module to aid in the testing of Spree controllers within not only the Spree components, but also within your application. The documentation at the top of this module should adequately describe how this works.

Deprecated functions

Spree::Zone

Spree::Zone#in_zone? is retired, please use Spree::Zone#include? instead.

Spree::PaymentMethod

Spree::PaymentMethod.current is retired, please use current_order.payment_method instead.

Additionally, current_gateway is also removed.

Spree::ProductsHelper

product_price is retired, please use number_to_currency instead.

Spree::HookHelper

hook is retired, please use Deface instead.

Spree::Variant

Spree::Variant.additional_fields has been deprecated in favour of using decorators and Deface. Please see #1406 for more information.

Patches

Version bumps

  • Paperclip version has been bumped to 2.7.0. #1148 + #1152
  • Stringex version has been bumped to 1.3.2 to prevent 1.3.1 from being used, as that release contained a bug.
  • nested_set version has been bumped to 1.7.0. 9b7eda3
  • jquery-rails version has been bumped to \~> 2.0.0. d4b3d7
  • deface version has been bumped to 0.8.0. e571ed
  • highline version has been bumped to 1.6.11. 45f5e2

Other fixes

  • Added admin/orders/address_states.js to precompile list. #754
  • Added initializer to warn about orphaned preferences. commit 4f2669
  • Address.default will no longer provide a nil value if the default country is deleted. #1142 + #997
  • Fix undefined_method to_d for PriceSack Shipping. #1156
  • Fixed rounding calculation bug for VAT. #1128 + #1172
  • Allow :error key to be passed to link_to_delete .#1169
  • Fix issue where assigning a price such as”$5” to a variant caused it to set the price to 0. #1173
  • Product names longer than 50 characters are now truncated. #1171
  • Fix issue where preferences set to false were not being saved. #1177
  • Fix incorrect variable name in script/rails file inside extension generator. #1135
  • Acknowledge Spree’s own locale settings before Rails.application.config.i18n.default_locale for Spree’s locale details. #1184
  • Fix issue where preferences set to an empty string were not being saved. #1187
  • Set default_url_options in mail_settings.rb so that it doesn’t need to be set manually for each environment or mailer. #1188
  • Correctly fire events for content paths and actions. #1141
  • Allow preferences with a type of :text.
  • Image settings (such as width & height) are now configurable via the Admin interface. 7d987fe
  • Fix bug where Payment#build_source would fail dependent on the ordering of the hash passed in. #981
  • Fix issue where states javascript include would be prefixed with asset host when alternate asset host was configured. #1213
  • Fix issue where Promotion#products would return no products due to incorrect class specification. #1237
  • Order email addresses are now validated with the Mail gem. #1238
  • Attempt to access /admin/products/{id} will now redirect to /admin/products/{id}. #1239
  • Show ‘N/A’ for tax category on /admin/tax_rates if a tax rate doesn’t have a tax category. #535
  • Fix issue where incorrect order assignment was breaking return authorization creation. #1107 #1109 #1149
  • Fix issue where under certain circumstances users were able to view other people’s order information. #1243
  • Fix issue where searching for orders by SKU was broken in admin backend. #1259
  • Logout when “Remember me” was checked for login now will actually log a user out. #1257
  • Spree::UrlHelpers has moved to Spree::Core::UrlHelpers 3bf5df
  • Preview buttons on the admin dashboard are now hidden once the dashboard has been configured. #1271
  • Slightly alter permalink code so that it does not conflict on similar names. Current permalinks will not be affected. #1254
  • Don’t allow payments to be created in admin backend unless payment methods have been defined. #1269
  • Address#full_name will now return a string with no extra spaces around it. #1298
  • Ensure StatesController always returns JS response. #1304
  • Fix issue where checkbox for “Use Billing Address” was not being checked for an order in admin backend when it was in the frontend. #1290
  • Fix issue where a shipping method could not be updated. #1331
  • Allow layout to be customized based on a configuration setting. #1355
  • Rails.application.config.assets.debug is no longer hardcoded to false in Spree. Set this variable at your discretion inside your config/application.rb from now on. #1356
  • Added gem_available? method to BaseHelper to be able to check if an extension is available. #1241
  • Fixed potential bug where Activator.active scope may have not been returning activators that were currently active. #1343
  • Fix incorrect route issue when updating a return authorization. #1343
  • Fixed issue where “Add to Cart” button may not work on IE7. #1397
  • Fixed issue where non-price characters were being stripped from prices. #1392 #1400
  • Limit ProductsController#show to only show active products. #1390
  • Spree::Calculator::PerItem will now calculate per-item, rather than per-line-item. This means that if you have a per-item calculator costing $1 and 3 line items with quantity of 5 that would be $15, rather than $3. #1414