Solidus v3.1 #4161
kennyadsl
announced in
Announcements
Solidus v3.1
#4161
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We just released Solidus 3.1! 🎉
If you have any issue updating, please use this discussion to get help or provide feedback.
Here's what changed:
Major changes
Spree.load_defaults
: preference defaults depending on the Solidus versionSolidus 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 yourspree.rb
initializer. As we're not changing any preference default on thisrelease, 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 futureupgrades will not be a safe option. Instead, you'll have to go through the new
update process detailed below.
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:
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 thespree.rb
initializer and remove the
new_solidus_defaults.rb
initializer altogether.You can read in more detail about this process on our
guides.
Other important changes
Spree::Price#amount
field can no longer benil
. Besides adding thevalidation 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 beforeexecuting the new migrations:
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:
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!!
Core
ShippingRateTaxer
service object #4136 (aldesantis)Variant#default_price
logic #4076 (waiting-for-dev)API
ReturnItem
s on create through API #4007 (forkata)Admin
Frontend
Docs & Guides
This discussion was created from the release v3.1.0.
Beta Was this translation helpful? Give feedback.
All reactions