v3.1.0
Major changes
Spree.load_defaults
: preference defaults depending on the Solidus version
Solidus 3.1 brings a new feature where preference defaults can take different
values depending on a specified Solidus version. It makes it possible to stop
deprecating old defaults every time we introduce a change in the recommended
value for a setting. After all, they're just that; recommendations. Instead,
now users can explicitly ask for a given Solidus version defaults and, as
before, override the preferences they want.
When upgrading to 3.1, you have to take action to adopt the new behavior.
You'll need to add Spree.load_defaults('3.1')
on the very top of your
spree.rb
initializer. As we're not changing any preference default on this
release, nothing will break. A warning will be emitted on boot-up until you do
it!
However, bumping the version given to load_defaults
straight away for future
upgrades will not be a safe option. Instead, you'll have to go through the new
update process detailed below.
- Allow using different preference defaults depending on a Solidus version #4064 (waiting-for-dev)
New update process
As aforementioned, preference defaults can change after a Solidus release. Once
you have your defaults locked to the current Solidus version, a new upgrade
won't break your application because of them. However, it's a good idea to
adapt your application to the updated recommended settings. To help with this
process, Solidus comes with a generator that you can execute like this:
bin/rails g solidus:update
That generator will create a new initializer called new_solidus_defaults.rb
,
which will preview all the defaults that have changed between versions, each on
a commented line. From that point, you can activate the new defaults one by one
and adapt your application incrementally. Once you're done with all of them,
you can bump the version given to Spree.load_defaults
in the spree.rb
initializer and remove the new_solidus_defaults.rb
initializer altogether.
You can read in more detail about this process on our
guides.
- Introduce Solidus update process #4087 (waiting-for-dev)
Other important changes
Spree::Price#amount
field can no longer be nil
. Besides adding the
validation at the model layer, we ship with a task that will remove records
where the amount is NULL
in the database. You should run the task before
executing the new migrations:
bin/rails solidus:delete_prices_with_nil_amount
bin/rails railties:install:migrations
bin/rails db:migrate
If you're running migrations automatically on deploy, you should run the task
before rolling out the new code. In that case, you first should make sure that
you have affected records:
Spree::Price.where(amount: nil).any?
If the above code returns false
, you don't need to do anything else.
Otherwise, copy the
task
into your code, and deploy & execute it. Another option is to execute it
manually in your console in production. However, be extremely careful when
doing that!!
Spree::Price.where(amount: nil).delete_all
- Do not allow prices with nil amount #3987 (waiting-for-dev)
Core
- Remove the upgrade task and point to additional steps from the update generator #4157 (waiting-for-dev)
- Make order-related service objects configurable #4138 (aldesantis)
- Remove unused
ShippingRateTaxer
聽service object #4136 (aldesantis) - Fix Ransack error when searching for orders by customer name #4135 (aldesantis)
- Exclude canceled orders in the #usage_count of promotions and promotion codes #4123 (ikraamg)
- Make clearer default answer in prompt #4101 (waiting-for-dev)
- Permit return_items_attributes return_reason_id #4080 (spaghetticode)
- Simplify
Variant#default_price
logic #4076 (waiting-for-dev) - Move currently_valid_prices to a method #4073 (waiting-for-dev)
- Support Ruby 3 #4072 (waiting-for-dev)
- Fix customer return validation for return items without inventory units #4068 (willianveiga)
- Add preferences to configure product and taxon images style #4062 (cpfergus1)
- Add UUID to StoreCredit#generate_authorization_code #4060 (spaghetticode)
- Fix Spree::Promotion.has_actions scope #4056 (mamhoff)
- Update defaults in dummy application #4047 (waiting-for-dev)
- Load defaults for the latest Rails minor version in the dummy app #4035 (waiting-for-dev)
- Handle permalink attribute on product create #4024 (nandita2010)
- Don't hack into ActionMailer to add our mail previews path #3961 (elia)
- Fix solidus stock locations sorting #3954 (ikraamg)
- Fix order checkout flow completion with custom steps #3950 (nerfologist)
- Add docker-compose development environment #3947 (waiting-for-dev)
- Allow Variant to check stock by stock_location #3884 (MadelineCollier)
- Normalize email required checks #3879 (elia)
- Improve the extensibility of Rules::ItemTotal #3431 (elia)
API
- Remove Pending Request Spec: Api Admin update payment state expectations. #4149 (jcowhigjr)
- Fix gateway_error when no order is defined #4156 (alexblackie)
- Moving API attribute helpers to API config #4039 (snada)
- Allow customer returns to reference existing
ReturnItem
s on create through API #4007 (forkata) - Let the PriceSelector return a Spree::Price #3925 (swively)
Admin
- Fix displaying of discarded variants in admin #4148 (luca-landa)
- Hide the master variants from stock management #4155 (tmtrademarked)
- Refactor frontend and backend locale_controllers #4126 (RyanofWoods)
- Fix admin portugues locale #4107 (ruipbarata)
- Add an HTML select element to filter orders by the shipment state #4089 (willianveiga)
- Fix detecting exec js version by adding minimal requirement for autoprefixer-rails #4077 (waiting-for-dev)
- Unhardcode admin base url in 'stock_location_stock_item' template #4063 (ok32)
- Fix "Cancel" URL link on reimbursement edit page #4061 (spaghetticode)
- [ADMIN] Properly format flash error message #3996 (spaghetticode)
- Consolidation of promotion code batch form fields into partial. #3957 (cpfergus1)
- Promotion rule product limit improvements #3934 (nirnaeth)
- eager load records instead of n+1 for update_positions #3875 (BenMorganIO)
- Update order_tabs Order number format #3835 (brchristian)
Frontend
- Move frontend locale_controller_spec to correct directory #4127 (RyanofWoods)
- Refactor frontend and backend locale_controllers #4126 (RyanofWoods)
- Fix flaky product feature spec #4118 (gsmendoza)
- Use symbols in polymorphic path for event_links #4048 (tvdeyen)
Docs & Guides
- Fix small typo in the 'customizing permissions' guide #4147 (nerfologist)
- Bump tar from 2.2.1 to 2.2.2 in /guides #4142 (dependabot)
- Document REST API params to control nested taxons #4131 (kennyadsl)
- Bump addressable from 2.5.2 to 2.8.0 in /guides #4129 (dependabot)
- Document REST API filtering with Ransack #4128 (kennyadsl)
- Guides typo corrections #4120 (cesartalves)
- Shipment Setup Examples documentation - small correction to the amount of shipping categories needed #4115 (cesartalves)
- Fix broken URL in customer-flow guide #4096 (RyanofWoods)
- Fix the dark mode issue with the logo on README.md #4093 (mfrecchiami)
- Small English correction on Payments overview PSP doc #4088 (cesartalves)
- Update the Nebulab's logo on README.md #4079 (mfrecchiami)
- Fix Request Bodies in API Documentation #4066 (kennyadsl)
- Fix links in CHANGELOG.md #4057 (bogdanvlviv)
- Bump hosted-git-info from 2.7.1 to 2.8.9 in /guides #4053 (dependabot)
- Bump lodash from 4.17.19 to 4.17.21 in /guides #4051 (dependabot)
- Review install instructions in README and Guides #4034 (kennyadsl)
- Use more appropriate language for woman's t-shirt in sample data #4031 (Noah-Silvera)
- Improve Customizing Attributes documentation #3979 (dhughesbc)
- Improve Solidus events documentation #3819 (spaghetticode)