spree_core 5.1.0.rc1 → 5.1.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10a63ea31ea45db426f45aa13fb90de77dac8ab0a024f7812562aed34991b9e8
|
4
|
+
data.tar.gz: 2ca5104581c280ce3b1328e52bfd8988971012feb01287174b4afa3ea494917c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f23f420db0bcced89590044a3b101754c934b06bc882adbe288163ef9b46166e829f79c824ad3eb83329ed8b6eb4e03aefcac8d1e5783eec42e7ba00ceb59dcb
|
7
|
+
data.tar.gz: d6c770cd94212ca2f919a62eeafc5bc58cc1440da8c3f98c9c6421c20fd12188995e0f93662225d0fb91d7afe769ae5488fc4b34360aeaa5fec2443e14216a49
|
@@ -48,7 +48,9 @@ module Spree
|
|
48
48
|
#
|
49
49
|
# Attributes
|
50
50
|
#
|
51
|
-
accepts_nested_attributes_for :option_values, reject_if:
|
51
|
+
accepts_nested_attributes_for :option_values, reject_if: lambda { |ov|
|
52
|
+
ov[:id].blank? && (ov[:name].blank? || ov[:presentation].blank?)
|
53
|
+
}, allow_destroy: true
|
52
54
|
|
53
55
|
#
|
54
56
|
# Callbacks
|
@@ -27,39 +27,39 @@ module Spree
|
|
27
27
|
upper_limit_condition = true
|
28
28
|
end
|
29
29
|
|
30
|
-
eligibility_errors.add(:base, ineligible_message_max) unless upper_limit_condition
|
31
|
-
eligibility_errors.add(:base, ineligible_message_min) unless lower_limit_condition
|
30
|
+
eligibility_errors.add(:base, ineligible_message_max(order)) unless upper_limit_condition
|
31
|
+
eligibility_errors.add(:base, ineligible_message_min(order)) unless lower_limit_condition
|
32
32
|
|
33
33
|
eligibility_errors.empty?
|
34
34
|
end
|
35
35
|
|
36
36
|
private
|
37
37
|
|
38
|
-
def formatted_amount_min
|
39
|
-
Spree::Money.new(preferred_amount_min).to_s
|
38
|
+
def formatted_amount_min(order)
|
39
|
+
Spree::Money.new(preferred_amount_min, currency: order.currency).to_s
|
40
40
|
end
|
41
41
|
|
42
|
-
def formatted_amount_max
|
42
|
+
def formatted_amount_max(order)
|
43
43
|
if preferred_amount_max.present?
|
44
|
-
Spree::Money.new(preferred_amount_max).to_s
|
44
|
+
Spree::Money.new(preferred_amount_max, currency: order.currency).to_s
|
45
45
|
else
|
46
46
|
Spree.t('no_maximum')
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
def ineligible_message_max
|
50
|
+
def ineligible_message_max(order)
|
51
51
|
if preferred_operator_max == 'lt'
|
52
|
-
eligibility_error_message(:item_total_more_than_or_equal, amount: formatted_amount_max)
|
52
|
+
eligibility_error_message(:item_total_more_than_or_equal, amount: formatted_amount_max(order))
|
53
53
|
else
|
54
|
-
eligibility_error_message(:item_total_more_than, amount: formatted_amount_max)
|
54
|
+
eligibility_error_message(:item_total_more_than, amount: formatted_amount_max(order))
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def ineligible_message_min
|
58
|
+
def ineligible_message_min(order)
|
59
59
|
if preferred_operator_min == 'gte'
|
60
|
-
eligibility_error_message(:item_total_less_than, amount: formatted_amount_min)
|
60
|
+
eligibility_error_message(:item_total_less_than, amount: formatted_amount_min(order))
|
61
61
|
else
|
62
|
-
eligibility_error_message(:item_total_less_than_or_equal, amount: formatted_amount_min)
|
62
|
+
eligibility_error_message(:item_total_less_than_or_equal, amount: formatted_amount_min(order))
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
data/lib/spree/core/engine.rb
CHANGED
data/lib/spree/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.0
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-07-
|
13
|
+
date: 2025-07-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n-tasks
|
@@ -1382,9 +1382,9 @@ licenses:
|
|
1382
1382
|
- BSD-3-Clause
|
1383
1383
|
metadata:
|
1384
1384
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
1385
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0
|
1385
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0
|
1386
1386
|
documentation_uri: https://docs.spreecommerce.org/
|
1387
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.1.0
|
1387
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.1.0
|
1388
1388
|
post_install_message:
|
1389
1389
|
rdoc_options: []
|
1390
1390
|
require_paths:
|