solidus_core 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/preferences/preferable_class_methods.rb +33 -2
- data/solidus_core.gemspec +6 -1
- metadata +8 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 84e6a49d44adf0951d9e774b0e212f39841ca0183827e5ec902d5dfb13f27cf2
|
|
4
|
+
data.tar.gz: 1d7e7b23b450a781782ac2259ccd50aa54b455c7b07e90070a2c39ff3320b640
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5caeff8f63a04cc9df497e06e3f782a0f6ff994464b98e5d9f1db58e3cf1149b1a02cf2dd707c4bb5291aad76ff91682df6797fcb56fd87522cda874bbcd0a2
|
|
7
|
+
data.tar.gz: 6150acbad591a8bc78d2283dd253deb1c5f47470194117a016d72e32cf633a5e9e56dbf7343d87fd0ffdef8cef4f7ea588ef45481acb918010fe4c2e647bee96
|
data/lib/spree/core/version.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'spree/deprecation'
|
|
3
4
|
require 'spree/encryptor'
|
|
4
5
|
|
|
5
6
|
module Spree::Preferences
|
|
@@ -26,8 +27,38 @@ module Spree::Preferences
|
|
|
26
27
|
options[:default] = preference_encryptor.encrypt(options[:default])
|
|
27
28
|
end
|
|
28
29
|
|
|
29
|
-
default =
|
|
30
|
-
|
|
30
|
+
default = begin
|
|
31
|
+
given = options[:default]
|
|
32
|
+
if ancestors.include?(Spree::Preferences::Configuration) &&
|
|
33
|
+
given.is_a?(Proc) &&
|
|
34
|
+
given.lambda? &&
|
|
35
|
+
given.arity.zero?
|
|
36
|
+
Spree::Deprecation.warn <<~MSG
|
|
37
|
+
The arity of a proc given as the default for a preference
|
|
38
|
+
has changed from 0 to 1 on Solidus 3.1. The Solidus
|
|
39
|
+
version for the loaded preference defaults is given as the
|
|
40
|
+
proc's argument from this point on.
|
|
41
|
+
|
|
42
|
+
If you don't need to return a different default value
|
|
43
|
+
depending on the loaded Solidus version, you can change
|
|
44
|
+
the proc so that it doesn't have lambda semantics (lambdas
|
|
45
|
+
raise when extra arguments are supplied, while raw procs
|
|
46
|
+
don't). E.g.:
|
|
47
|
+
|
|
48
|
+
preference :foo, :string, default: proc { true }
|
|
49
|
+
|
|
50
|
+
If you want to branch on the provided Solidus version, you can do like the following:
|
|
51
|
+
|
|
52
|
+
preference :foo, :string, default: by_version(true, "3.2.0" => false)
|
|
53
|
+
|
|
54
|
+
MSG
|
|
55
|
+
->(_default_context) { given.call }
|
|
56
|
+
elsif given.is_a?(Proc)
|
|
57
|
+
given
|
|
58
|
+
else
|
|
59
|
+
proc { given }
|
|
60
|
+
end
|
|
61
|
+
end
|
|
31
62
|
|
|
32
63
|
# The defined preferences on a class are all those defined directly on
|
|
33
64
|
# that class as well as those defined on ancestors.
|
data/solidus_core.gemspec
CHANGED
|
@@ -55,7 +55,12 @@ $ bin/rails g solidus:install
|
|
|
55
55
|
If you are updating Solidus from an older version, please run
|
|
56
56
|
the following commands to complete the update:
|
|
57
57
|
|
|
58
|
-
$ bin/rails solidus:
|
|
58
|
+
$ bin/rails g solidus:update
|
|
59
|
+
|
|
60
|
+
Please, don't forget to look at the CHANGELOG to see what has changed and
|
|
61
|
+
whether you need to perform other tasks.
|
|
62
|
+
|
|
63
|
+
https://github.com/solidusio/solidus/blob/master/CHANGELOG.md
|
|
59
64
|
|
|
60
65
|
Please report any issues at:
|
|
61
66
|
- https://github.com/solidusio/solidus/issues
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solidus_core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.1.
|
|
4
|
+
version: 3.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Solidus Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-09-
|
|
11
|
+
date: 2021-09-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionmailer
|
|
@@ -928,7 +928,12 @@ post_install_message: |
|
|
|
928
928
|
If you are updating Solidus from an older version, please run
|
|
929
929
|
the following commands to complete the update:
|
|
930
930
|
|
|
931
|
-
$ bin/rails solidus:
|
|
931
|
+
$ bin/rails g solidus:update
|
|
932
|
+
|
|
933
|
+
Please, don't forget to look at the CHANGELOG to see what has changed and
|
|
934
|
+
whether you need to perform other tasks.
|
|
935
|
+
|
|
936
|
+
https://github.com/solidusio/solidus/blob/master/CHANGELOG.md
|
|
932
937
|
|
|
933
938
|
Please report any issues at:
|
|
934
939
|
- https://github.com/solidusio/solidus/issues
|